Learn

VISUAL GUIDE · SCALING & CACHING

Where a cache helps (and where it lies)

Step 6 of 9: The cache serves the old answer

STEP 6 / 9ORIGINAL SKETCH
GET /abc123get, set on missread alias302 Locationedit targetBrowserRedirect serviceAlias cacheTTL 60 s!old target servedAlias 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.
6 / 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 6 OF 9 · STALE HIT

The cache serves the old answer

The next browser asks for /abc123. The cache has an unexpired entry, so the service returns the old target. From the cache's point of view this is a perfectly good hit.

A stale hit is not a bug in the cache. It is the trade you made for skipping the store: you agreed to be wrong for a while in exchange for not asking.

Why it matters. Staleness is the price of every cache. Naming how stale is acceptable is part of the design, not an afterthought.