Learn

VISUAL GUIDE · SCALING & CACHING

Where a cache helps (and where it lies)

Step 7 of 9: The TTL caps how long it stays wrong

STEP 7 / 9ORIGINAL SKETCH
GET /abc123get, set on missread alias302 Locationedit targetBrowserRedirect serviceAlias cacheTTL 60 sexpires in ≤ 60 sAlias storesource of truthOwner ormoderator
A browser asks a redirect service for a short link; the service checks a cache, falls back to the alias store on a miss, checks a disabled list, and a link owner or moderator can edit the store, purge the cache, or disable a link.
7 / 9
  1. No cache
  2. Add a cache
  3. Cache hit
  4. Cache miss
  5. Link changes
  6. Stale hit
  7. TTL bounds it
  8. Purge
  9. Deny-list

STEP 7 OF 9 · TTL BOUNDS IT

The TTL caps how long it stays wrong

Even if nothing else happens, the stale entry expires within 60 seconds and the next miss loads the new target. The TTL is the worst-case staleness for this cache.

Every cache on the path needs its own bound, including the browser. A 302 is not cached by browsers unless you add caching headers; a 301 can be cached with no expiry, and you cannot purge a stranger's browser.

Why it matters. A TTL turns "might be wrong" into "wrong for at most N seconds", which is something product and legal teams can agree to.