Try
↑ ↓ move↵ openesc close

Interview prep / CDNs and edge caching

Senior · CDNs and edge caching · System design interview question

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

Learn it by running it

The cdns and edge caching lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms