From the depot
miss128 ms
2,800 km to the depot and back.
Module 21 · Caching & CDNs
A shop that answers every request from one place makes far customers wait, and buckles when everyone shows up at once. Here you put copies in Larkspur’s regional warehouses, then keep them right through a price change and a flash sale.
The whole idea in one example
128 ms
2,800 km to the depot and back.
12 ms
A copy in the West warehouse, no trip.
Waits come from a simulated day: Larkspur’s own traffic and planning numbers, not a measurement of any real network or CDN.
How it works
A shelf near customers answers repeat requests
HTTP caching (RFC 9111) calls a stored response fresh while its age has not yet passed its freshness lifetime, the time from when the origin made it to when it expires.
Source, checked 24 October 2026
A copy kept too long goes stale
A max-age directive tells a cache to treat the response as stale once its age is greater than that many seconds (RFC 9111).
Source, checked 24 October 2026
A purge drops the old copy everywhere
MDN: there is no way to delete responses that an intermediate cache stored with a long max-age; a CDN that offers purging lets you cache aggressively and purge only when the content changes.
Source, checked 24 October 2026
Customers asking together share one trip
Fastly’s documentation describes request collapsing: one request goes to the origin, the others wait on a waiting list, and the one response is cached and served to all of them.
Source, checked 24 October 2026
The story
Larkspur Supply Co.’s online shop runs from one depot; the team puts copies in three regional warehouses and keeps them right through a price change and a flash sale. You’re on the team that runs the shop.
Played Context engineering or Inference engineering? Chapter 6 shows their caches are the same trick.
Your path





Chapter 5 · done
What happens when everyone asks for the same thing at the same moment?


Chapter 7 · done
Which policy keeps the most requests on the shelves within the limits?
Anyone whose product serves pages, images or data to people spread out over a map, and who wants to know why a fast page can show an old price. No background needed.