Learn

VISUAL GUIDE · SCALING & CACHING

Where a cache helps (and where it lies)

Step 9 of 9: A takedown cannot wait for a cache

STEP 9 / 9ORIGINAL SKETCH
GET /abc123get, set on missread aliasdisabled?purgedisableBrowserRedirect serviceAlias cacheTTL 60 s!Alias storesource of truthDisabled listsmall, replicatedchecked every timeOwner 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.
9 / 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 9 OF 9 · DENY-LIST

A takedown cannot wait for a cache

Now a moderator finds that /abc123 points to a phishing page. Even 60 seconds of redirects is too long, and a lost purge would leave it live.

So the moderator writes the alias to a small disabled list, and the redirect service checks that list on every request, including cache hits. A disabled alias gets a warning page no matter what the alias cache holds.

The list stays tiny because takedowns are rare, so checking it costs almost nothing. Copying it to every service instance still takes a few seconds, but that delay does not depend on TTLs or on a purge arriving. The purge still goes out to clean up the cache, but safety no longer depends on it.

Why it matters. When one kind of wrong answer is unacceptable, enforce it on the path every request takes instead of hoping every copy gets updated.