Learn

VISUAL GUIDE · SCALING & CACHING

Where a cache helps (and where it lies)

Step 3 of 9: A hit skips the store

STEP 3 / 9ORIGINAL SKETCH
GET /abc123get, set on missread alias302 LocationBrowserRedirect serviceAlias cacheTTL 60 sAlias storesource of truth
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.

Where the time goesIllustrative · see assumptions

  • Cache read1 ms
  • Store read avoided8 ms

Total ≈ 9 ms

3 / 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 3 OF 9 · CACHE HIT

A hit skips the store

The cache has /abc123, so the service answers straight away. The store is not touched.

With a 60-second TTL, the store sees about one read per minute per cache node for this alias instead of 4,000 per second. The redirect also gets a little faster, but the load drop is the real win.

Why it matters. A hit protects the system behind the cache. Measure a cache by how much load it removes from the store, not only by milliseconds saved.