Try
↑ ↓ move↵ openesc close

Interview prep / CDNs and edge caching

Junior · CDNs and edge caching · System design interview question

What does a CDN do, and why does it help?

Sketch your own answer first, then compare it with the one below.

A strong answer

A CDN runs caches in many places, called edges, in front of your origin. A user's request goes to a nearby edge. If the edge has a fresh copy it answers at once. If not, it asks the origin, keeps the reply and answers.

It helps in two ways. Users get answers from a short distance, so latency falls. The origin sees only the misses, so its load grows much more slowly than traffic.

The trade-off is that copies can be out of date, so you set rules for how long they may be reused.

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