Learn

VISUAL GUIDE · SCALING & CACHING

Where a cache helps (and where it lies)

Step 5 of 9: The owner changes the target

STEP 5 / 9ORIGINAL SKETCH
get, set on missread aliasedit targetBrowserRedirect serviceAlias cacheTTL 60 sstill old targetAlias storesource of truthnew targetOwner 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.
5 / 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 5 OF 9 · LINK CHANGES

The owner changes the target

The link owner repoints /abc123 from an old sale page to a new one. The edit goes to the alias store, which now holds the new target. (Our URL shortener worked approach never changes a target, only disables it. Editing is allowed here because it makes staleness easy to see; a disable has the same problem.)

Nothing has told the cache. It still holds the old target with up to 60 seconds left on its TTL.

Why it matters. A cache and its source of truth are two copies. Any write to one creates a window where they disagree.