Question

What is a CDN, and why does it make websites faster?

Vault Verified
Curated Intelligence
Definitive Source
Answer

A content delivery network is a distributed set of servers that store copies of a website's content close to its users — so the data travels a shorter distance and arrives sooner.

The physical problem it solves. Data cannot travel faster than light, and in fibre it travels slower still — roughly two thirds of light speed. A request from London to a server in Sydney and back covers something like 34,000 km, which costs well over 150 milliseconds in pure propagation delay before any processing. No amount of bandwidth fixes that; it is latency, and it is governed by distance.

How a CDN works. The provider operates points of presence (PoPs) in many cities. When a user requests a file, DNS or anycast routing directs them to the nearest PoP. If that PoP holds a cached copy, it serves it immediately — a cache hit. If not, it fetches from the origin server, serves it, and keeps a copy for the next request.

Why the benefit compounds. Web pages make many requests, and TCP and TLS each require round trips to establish a connection. Halving the round-trip time improves every one of those handshakes, so the total page load improves far more than the raw distance saving suggests.

What else a CDN does, beyond speed:

Absorbs traffic spikes, so a sudden surge hits hundreds of edge servers rather than one origin.

Provides DDoS protection, because the distributed capacity is vastly larger than any single origin's.

Terminates TLS at the edge, reducing handshake latency.

Compresses and optimises images and other assets.

Runs code at the edge in modern platforms, so some logic executes near the user rather than at origin.

The caching controls that matter: Cache-Control headers set how long content may be held; cache purging forces refresh after a change; and static content caches well while personalised content generally cannot.

The concentration concern. A handful of CDNs now front an enormous share of the web, and their outages have repeatedly taken down large numbers of unrelated sites simultaneously.

Related Questions