CDN
Definition
A CDN is a caching layer placed in front of wherever your files actually live. A visitor's request is routed to the nearest participating server rather than to the origin server, and if that server already holds a fresh copy it replies immediately. If it does not, it fetches once from the origin, stores the result and serves everyone afterwards from local storage. Three terms describe the same system at different zoom levels: the CDN is the whole service you buy or are given, the edge network is the fleet of machines it operates, and a point of presence is one individual site in one city. What is cached and for how long is decided almost entirely by the header the origin sends with each response.
Why It Matters
Distance is the dominant cost in loading a page, and no amount of server tuning removes it. A request from Sydney to a server in Frankfurt covers roughly 16,000 kilometres each way and cannot beat about 160 milliseconds of round trip even on a perfect link; served from a cache in Sydney the same file arrives in 15 to 30. Multiply that by a page with thirty assets and the gap becomes seconds, not milliseconds. There is a second benefit people notice later: load. With a 95 percent cache hit ratio only one request in twenty reaches the origin, so a traffic spike that would have flattened a single machine is absorbed by hundreds.
How It Works
DNS does the routing. The hostname resolves through anycast or geographic mapping so that a lookup from Lisbon and one from Osaka return addresses of different nearby nodes. The chosen node checks its store for the requested path; a hit is served straight away, and a miss is fetched from the origin, saved according to Cache-Control and s-maxage, and passed on. Responses usually carry an Age header and a vendor header such as X-Cache showing HIT or MISS, which is how you check whether caching is working at all. Many providers add an origin shield, a single designated node that all others fetch through, so a cold file is pulled from the origin once instead of once per city.
Real-World Example
A games studio puts a 40 MB press kit on 99helpers at orrin-press.99helpers.site and it is picked up by outlets in Europe, North America and Japan on the same morning. The first download in each region pulls the ZIP from storage once; every journalist after that gets it from a machine in their own region, so a Tokyo reporter waits a couple of seconds rather than most of a minute. The studio did not sign up for anything or change a hostname — files published on 99helpers are delivered this way by default.
Common Mistakes
- ✕Expecting it to speed up content that is different for every visitor — a personalised response cannot be shared, so it is a cache miss every time and you have added a hop for nothing
- ✕Putting one in front of a site that sends no-store on everything — nothing is ever stored, the hit ratio is zero, and the bill buys you a proxy
- ✕Publishing a fix and assuming it is live everywhere at once — each node keeps its own copy until that copy expires or is purged
- ✕Measuring speed from the office after loading the page twice — you are testing your nearest node with a warm cache, which tells you nothing about a first visit from another continent
Related Terms
Edge Network
The fleet of servers a delivery provider runs in cities around the world, positioned close to visitors rather than close to your origin. It is the machinery a CDN is built from.
Point of Presence
A single physical location in a delivery network — the racks of servers in one city that answer requests from that region. Shortened to PoP, it is the smallest unit an edge network is counted in.
Cache-Control
The HTTP response header that tells browsers and caches whether they may keep a copy of a file, for how long, and who is allowed to. It is the single biggest lever over how fast a site feels on a second visit.
Cache Hit Ratio
The share of requests answered from a cache rather than passed back to the origin, written as a percentage. It is the one number that tells you whether your caching setup is doing anything.
Origin Server
The machine or service holding the authoritative copy of a site, which a cache asks whenever it does not already have what a visitor wanted. Origin is a position in a delivery chain, not a kind of software.
Put a file online in seconds
Drop in a document, an image, a page or a whole static website and share the link — free, with no build step and no server to set up.
Host a file free →