A new page goes live and a million users ask for it within a minute. How do you protect the origin?
Sketch your own answer first, then compare it with the one below.
A strong answer
The risk is that every edge misses on the new object at once, and the origin sees a burst of identical requests.
A good answer combines several tools. Collapse concurrent misses at each edge, so one request goes to the origin and the others wait for it. Add a shield so that edges share one fetch. Warm the cache before launch by requesting the object through the CDN. Give the response a TTL that suits the content and use stale-while-revalidate so that refreshes do not block users.
Then say what you would watch: origin request rate, hit ratio per object, and error rate. Name the trade-off. Collapsing makes waiting users share one slow fetch, so a slow origin slows them all, which is why you also set a timeout.
Sources
- Roy Fielding, Mark Nottingham, Julian Reschke (2022). RFC 9111: HTTP Caching.
- Mark Nottingham (2010). RFC 5861: HTTP Cache-Control Extensions for Stale Content.