Add #cache['downstream-ttl'] to force expiration after a certain time and fix #cache['max-age'] logic by adding #cache['age']

Created on 10 March 2015, over 9 years ago
Updated 30 April 2024, 7 months ago

Problem/Motivation

Lets assume we have 3 objects, which are nested in each other in the following way.

Object 1: 10 min
Object 2: PERMANENT

Object 1: 10 min
Object 3: PERMANENT

In words:

Object 1 is part of both Object 2 and 3 and Object 1 changes every 10 min.

So lets assume at t=0, Object 1 has content of 0, at t=600, it has content of t=600, etc.

So object 1 is cached at time t=0 to the cache with a ttl of 600.
So object 2 is cached at time t=2 to the cache with a ttl of 600 (inherited from object 1).

The request to Object 3 happens at time t=590.

Because object 1 is still cached at that time, object 3 now contains object 1 with content of '0'.

Object 3 is cached for 600 s.

So at time of e.g. t=1100 the contents of object 3 shows '0' for object 1, which is wrong as it should be t=600 from t=600-1200.

So for 2 cache hierarchies this almost doubles, but for three it is in the worst pattern a minimum of 3 times, etc.

So in other words you configure 1 hour and for some users its still not changed after 4 hours.

Proposed resolution

Akamai solves this problem in an elegant way by using an age property and effectively setting max-age to the current age.

In our above example:

The request to Object 3 happens at time t=590.

Because object 1 is still cached at that time, object 3 now contains object 1 with content of '0'.

Object 3 would be cached for 600s, but because the age of object 1 is 590 already, the max-age of object 3 is reduced to 10, which makes it correct.

Again this is about correctness and less about performance, yet.

Because it might be feasible that I want this to be 10 min, no matter what and don't care about the cache hierarchy prolonging it, I can in Akamai set a downstream-ttl that works like max-age now.

Its definitely possible to put a placeholder for something with a TTL to draw that later ...

Related reading: http://www.akamai.com/dl/technical_publications/akamai_esi_developers_gu...

Remaining tasks

- Discuss
- Patch

User interface changes

API changes

📌 Task
Status

Active

Version

11.0 🔥

Component
Cache 

Last updated about 6 hours ago

Created by

🇩🇪Germany Fabianx

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024