Table of Contents
Open a product page from Lagos and the server answering you might be sitting in Virginia. That request crosses an ocean, negotiates a connection, and waits for a reply before a single pixel renders. On a good day that costs you about 200 milliseconds of round-trip time. On a congested mobile network it creeps past 600.
Content delivery networks exist to delete that distance. Rather than one origin server handling every visitor on earth, a CDN keeps copies of your site in hundreds of locations and answers each person from whichever one is nearest. The mechanics are far less mysterious than the marketing copy suggests, and understanding them tells you exactly when a CDN will rescue your page speed — and when it will quietly do nothing at all.
What happens on a request that hits the cache
Follow a single visitor through a typical setup. Their browser asks DNS for your domain, and because the domain points at an anycast address, the network itself routes them to the closest edge location. That edge terminates the TLS connection, decrypts the request, and looks in its local cache.
First visitor of the day: cache miss. The edge forwards the request to your origin over a connection it keeps warm and pooled, receives the HTML, stores a copy according to the Cache-Control headers you set, and sends it back. Measured at the edge, that’s maybe 300ms.
Everyone after that gets the stored copy. Twenty to forty milliseconds, no origin involvement, no database query, no PHP worker waking up. Multiply that across a hundred thousand visitors and you’ve replaced a hundred thousand trips to your server with a handful.
Distance is the part nobody can code around
Light in fibre travels at roughly two-thirds of its vacuum speed, so a round trip from Singapore to Frankfurt and back takes about 170ms no matter how fast your server is. And a page load isn’t one round trip. There’s the DNS lookup, the TCP handshake, the TLS handshake, the HTTP request, and the response — each one potentially waiting on the previous. The full stack of DNS lookups, TCP handshakes and TLS negotiation routinely adds 400ms before the browser has received a single byte of content.
A CDN attacks all of it at once. Terminating TLS at an edge location 15ms from the visitor instead of 170ms away turns a four-round-trip setup into something the browser barely notices, especially with TLS 1.3 and session resumption doing their work on repeat visits.
Caching is where most of the speed actually lives
Edge locations are only useful if they have something to serve. The configuration work — cache rules, TTLs, purge strategies — matters more than the size of the provider’s network map.
What belongs in the cache
Images, fonts, CSS, JavaScript bundles and video are obvious candidates and should carry long TTLs with content-hashed filenames. Product and category HTML can usually be cached for a few minutes with stale-while-revalidate, which lets the edge serve a slightly aged copy while it refreshes in the background. Public API GET responses are often cacheable for 30 to 60 seconds and that alone can halve origin load during a launch.
The number to watch
Cache hit ratio is the single most honest metric in the whole setup. A well-tuned content site sits between 90% and 97%. A store that misses on 60% of requests because every URL carries a session parameter isn’t really using its CDN — it’s paying for a very expensive reverse proxy.
Dynamic content gets help too
Personalised pages can’t be cached wholesale, but the connection between edge and origin can still be optimised. Origin shielding funnels all requests from a region through one edge node so your server sees one connection instead of forty. Tiered caching does something similar between edge tiers. Smart routing providers steer traffic around congested internet segments, which on transcontinental routes is worth 30% or more on time-to-first-byte.
Then there’s the boring plumbing: Brotli compression at the edge, HTTP/3 over QUIC for flaky mobile connections, and early hints that push a preload before the HTML finishes arriving.
Under load, the CDN becomes a shock absorber
A flash sale or a press mention can send traffic up tenfold in five minutes. If 95% of that lands on the cache, your origin barely registers it. Other practical wins:
- DDoS absorption. Volumetric attacks measured in terabits per second get spread across an anycast network and filtered before they reach your hosting provider.
- Image resizing at the edge. Serve a 400px WebP to a phone instead of a 2400px JPEG, cutting 80% of the bytes and a good chunk of your bandwidth bill.
- Signed URLs and geo rules. Protect paid downloads or restrict catalogue pricing by region without touching application code.
- Bandwidth offload. Video and large assets stop counting against origin egress, which is often the largest line item on a hosting invoice.
This is the same architectural logic that sits behind building a scalable web application: push work outward, keep the origin doing only what it alone can do.
Where a CDN stops helping
Honesty matters here. A CDN cannot fix a slow database. If your product page takes 2.1 seconds of server time to render, caching helps only the requests that hit — and a 50% hit ratio means half your visitors still wait those 2.1 seconds.
Personalisation is the usual stumbling block. Shopping carts, logged-in dashboards and account pages must bypass the cache by definition, which is why the architecture choices in enterprise commerce builds lean on edge computing and private caching rather than a blanket no-cache rule. Cache invalidation is the other trap. Set a 24-hour TTL on a page showing stock levels and you’ll be selling items you don’t have by lunchtime.
How to check whether it’s working
Guessing is pointless when the data is available. Pull real-user monitoring data split by country and compare time-to-first-byte before and after the CDN went live. A visitor in São Paulo should see their TTFB drop from 900ms to under 200ms. If it hasn’t moved, the cache isn’t being hit.
Watch the 75th percentile for Largest Contentful Paint, not the average — averages hide the slow connections that cost you sales. Google’s Chrome UX Report gives you this for free at origin level. For a retail site, tie the numbers back to revenue: mobile checkout drop-off is unforgiving, as the shifts in m-commerce behaviour keep demonstrating year after year. The same logic applies to the landing pages you send paid traffic to, where a two-second delay can burn a meaningful share of an ad budget before the visitor ever sees an offer.
What to check before you sign a contract
Pricing structures vary wildly and the headline per-GB rate rarely tells the story. Ask about egress overage, request-based charges, and whether image optimisation or bot management costs extra. Look at whether the provider has genuine points of presence in the regions your analytics say your users live — a network map with 300 cities means little if none are near your traffic.
Then test the operational side. How fast is a cache purge? Can you deploy edge logic in JavaScript or WebAssembly without a separate build pipeline? Does the dashboard let a non-engineer flush a URL when a price changes at 11pm? Those questions decide whether the CDN becomes part of how your team ships, or a black box nobody wants to touch. Get the answers in writing, run a two-week pilot on a subdomain with real traffic, and compare the numbers against your current baseline. That’s the only benchmark that matters.


