ELI5 · Networking & the web

CDNs.

A local branch of the warehouse, so your delivery comes from across town, not across the world.

If a website lives on one server in, say, Virginia, then someone loading it from Tokyo has to wait for every byte to cross the planet and back. Distance is time, and it adds up.

A CDN fixes this by keeping copies of the site’s files on hundreds of servers spread around the world. You get them from the nearest one instead of the faraway origin.

  1. …delivery estimate?
    origin
    1

    With one origin server, a faraway visitor waits for every byte to cross the planet.

  2. …47 min later
    2

    Distance is time — and it adds up on every single byte.

  3. 3

    A CDN stocks copies on servers all around the world.

  4. Now we’re talking.
    nearby copy
    4

    You fetch from the closest one — a short hop, not a world tour.

  5. origin
    5

    The edge soaks up the crowd, so the origin faces a trickle instead of a flood.

  6. Extra pineapple? That one’s bespoke.
    CUSTOM + pineapple origin
    6

    Shared files come from the edge; truly personal or live data still comes from the origin.

A local branch of the warehouse, so your delivery comes from across town.

What gets cached, and what does not

CDNs shine for things that look the same for everyone and do not change often: images, video, stylesheets, scripts, fonts. A copy can sit at the edge for a long time and serve millions of people.

Truly personal or constantly-changing content — your account page, a live price — still comes from the origin. Modern CDNs blur this line by caching cleverly and even running small bits of code at the edge.

Why it also protects the origin

Because the edge servers answer most requests, the origin only sees a trickle of traffic. That makes the whole system cheaper to run and far more resilient to surges, since no single machine has to face the crowd alone.

The real version How a CDN works →
Found this useful?