The Distance Problem CDNs Solve
Data travels at roughly the speed of light through fiber — but "roughly the speed of light" still means that a request from London to a server in San Francisco takes about 85ms in each direction, just from physics. Round-trip latency between continents routinely exceeds 150ms, and each page visit requires several round trips before content appears.
A Content Delivery Network solves this by placing copies of your content — images, CSS, JavaScript, video, fonts — on servers distributed across dozens or hundreds of locations worldwide. When a user in Tokyo requests your CSS file, they get it from an edge server in Tokyo, not from your origin server in Virginia. That 180ms round trip becomes a 5ms one.
How a CDN Works: Edge Servers and Caching
A CDN operates through a network of edge servers, also called Points of Presence (PoPs). Each PoP is a data center in a specific city — London, Singapore, São Paulo, Chicago — loaded with servers that cache your content.
When a user requests a resource, their DNS query routes them to the nearest edge server. If that edge server has a cached copy (a cache hit), it responds immediately. If it doesn't (a cache miss), it fetches the file from your origin server, stores a local copy, and then serves the user. All subsequent requests from that region go to the edge cache until the cache entry expires.
Cache expiry is controlled by HTTP headers — primarily Cache-Control with a max-age directive, and the CDN's own TTL configuration. A Cache-Control: max-age=31536000 header tells edge servers to cache that file for one year.
What a CDN Caches — and What It Doesn't
| Typically Cached | Typically Not Cached |
|---|---|
| Images (JPEG, PNG, WebP, SVG) | Dynamic API responses with user-specific data |
| CSS and JavaScript files | Shopping cart contents, checkout pages |
| Web fonts (WOFF2, TTF) | Pages behind authentication |
| Video and audio files | Real-time data (stock prices, live feeds) |
| Static HTML pages | Form submission responses |
| PDF and document downloads | Search results with personalized rankings |
Modern CDNs can also cache dynamic content with short TTLs or with logic that varies the cache by cookie, header, or geographic region — but the core benefit remains serving static assets from the edge.
How CDNs Use Anycast and DNS to Route Users
CDNs use two main techniques to ensure users hit a nearby edge server. The first is DNS-based routing: when a user resolves a CDN hostname, the CDN's authoritative DNS server returns the IP address of the geographically closest PoP. The second is anycast routing: the same IP address is announced from multiple data centers via BGP, and the internet's routing protocol delivers packets to the nearest one automatically.
The result is transparent to the user. Visiting a site backed by a CDN looks identical to visiting one without — the difference is only in the milliseconds it takes the response to arrive.
CDN Benefits Beyond Speed
Absorption of traffic spikes: When a page goes viral or a product launch drives sudden traffic, CDN edge servers absorb the load. Without a CDN, origin servers that were fine under normal traffic can buckle under a spike.
DDoS protection: A CDN's distributed network can absorb volumetric attacks — thousands of servers in dozens of cities collectively handle traffic that would overwhelm a single origin. The attack traffic is spread across the network and filtered before reaching the origin.
Reduced origin bandwidth cost: Every cache hit is a request that never touches the origin server. For media-heavy sites, this can reduce origin bandwidth consumption by 80–95%.
TLS termination at the edge: CDNs typically terminate TLS connections at their edge servers, which are geographically close to users. This means the expensive TLS handshake happens over a short network path rather than a transcontinental one.
When a CDN Doesn't Help
CDNs have limited benefit for applications where every response is unique per user (API calls returning personalized data), for very small sites serving a local audience (where the origin is already close to all users), or for non-cacheable data like WebSocket streams or server-sent events. In these cases a CDN still adds value for static assets but does not accelerate the primary application traffic.
Frequently Asked Questions
What does CDN stand for?
CDN stands for Content Delivery Network — a distributed network of servers that cache and serve content from locations close to end users.
What is an edge server?
An edge server is a CDN server located close to end users. Your DNS query resolves to a nearby edge node, which serves cached content or fetches it from the origin and caches it for future requests.
Do CDNs improve SEO?
Yes, indirectly. Search engines use page speed as a ranking signal. CDNs improve TTFB, LCP, and Core Web Vitals scores — all of which influence rankings. Faster sites also reduce bounce rates, which is another positive signal.
Can a CDN hide my origin server?
Yes. Users connect to CDN edge servers, not your origin directly. Keeping your origin IP private prevents attackers from bypassing the CDN. Most CDN providers offer DDoS protection and IP masking as part of their service.
What is CDN cache invalidation?
Cache invalidation removes or expires cached content before its TTL expires — necessary when you update a file. Most CDNs offer instant purge APIs that propagate changes to all edge nodes worldwide within seconds.
Is a CDN the same as a reverse proxy?
A CDN is a geographically distributed type of reverse proxy. Both sit in front of origins and forward requests, but a CDN deploys nodes across dozens of locations to minimize distance-based latency — something a single reverse proxy cannot do.