Caching TTL (Time-To-Live) 00:00:01 Sixty seconds from which event? A ticket office stores a value at time zero with a sixty-second absolute lifetime. Watch whether a read at the end of that interval makes the original information younger. The value is stored at 0 and may be used until 60. A hit. The expiry stays at 60. Still a hit, with one second left. Popularity does not help. Expired, so a miss. A fresh value is stored and the clock starts again. A hit on the new copy, 20 seconds old. An absolute deadline bounds a particular copy's eligibility. It cannot establish that the underlying value was fresh when copied or that other cache layers share the same deadline. 00:00:43 A popular entry never gets to rest Now compare a sliding expiry that refreshes after a qualifying access. The ticket office wants often-used information to stay available while forgotten entries disappear. 60 seconds left. A hit. The clock goes back to 60. Ten seconds were left. Reset again. One second was left. The value is now 139 seconds old, and the cache is happy. Sixty quiet seconds have passed. A miss at last. Repeated access can keep the same value eligible for a long time. Add an independent age or version bound when correctness depends on learning an authoritative change. 00:01:25 Ten thousand identical timers hit zero Thousands of ticket pages were filled together. A synchronized lifetime can turn one quiet second into thousands of origin requests. Compare the concentrated and spread-out refill schedules. Every key expires at 600 seconds: 10,000 refreshes in one moment. Each key gets between 540 and 660 seconds. About 2,500 keys expire in each 30-second slice from 540 to 660. That is roughly 83 a second. Jitter distributes expiry opportunities but does not guarantee a hard peak limit. Bound origin concurrency separately and avoid extending a deadline beyond a contractual freshness requirement. 00:02:07 A new outer copy can contain an old inner value A delivery cache refreshes from an internal cache that has almost used its own lifetime. Calculate the age of the underlying observation, not just the time since the outer copy was written. The copy in Redis has been there for 119 of its 120 seconds. Then the database value changes. The API answers from Redis: fresh by its own clock. For up to 300 more seconds the CDN answers without asking. On an important change, delete the Redis key first and then purge the CDN. In the other order the CDN could refill from the old key. Propagate a version or original observation time when layers must share an end-to-end age bound. Ordered invalidation alone can still race with concurrent refills. 00:02:51 Idle limits and total session life A user remains active all afternoon. One policy expires a session after inactivity; another ends it after a fixed total lifetime. Decide which clock each request is allowed to move. Idle limit 20, total limit 60. A request every 15 minutes keeps the session alive. At 60 minutes the session ends although the user is active. They log in again. The mandatory total lifetime wins even during steady activity. The ticket office can now explain whether a deadline measures storage age, idle time or the age of an actual fact.