Content Delivery Network (CDN)
A distributed network of edge servers that caches content closer to users.
Last reviewed: July 25, 2026
What is a CDN?
A CDN stores copies of static assets — images, JavaScript, CSS, videos — on servers around the world. When a user in Tokyo requests your site, they often receive files from a nearby edge node instead of your origin server in Virginia.
How it works
- First request for a file may go to your origin (S3, web server, etc.)
- The CDN caches the response at the edge
- Subsequent requests are served from cache until TTL expires
Benefits
- Lower latency — shorter physical distance to content
- Reduced origin load — fewer hits to your primary infrastructure
- DDoS absorption — large CDNs can absorb traffic spikes at the edge
- TLS termination — certificates managed at edge locations
What CDNs cache well
Static files, public API GET responses (with correct cache headers), and streaming video segments. Dynamic personalized pages usually bypass cache or use short TTLs.
Popular providers
Cloudflare, Fastly, Akamai, Amazon CloudFront, Azure CDN, and Google Cloud CDN. Many teams use a CDN in front of object storage for global static hosting.
Cost reality
CDNs are usually the cheapest bandwidth you can buy — often cheaper than serving from your origin, since cached hits never touch your servers. The catches: per-request fees add up on millions of tiny files, and misconfigured cache headers quietly send everything to the origin at full price. Check your cache hit ratio monthly; below ~80% for static-heavy sites means money is leaking.
What people get wrong
- Caching without a purge plan. Deploying new JS while the CDN serves week-old copies is the classic “works on my machine, broken for users” incident — version your asset filenames.
- Trusting default headers. No
Cache-Controloften means no caching; the CDN becomes an expensive pass-through. - Putting authenticated, personalized pages behind aggressive caching. One user seeing another’s account page is a breach, not a bug.
How CDNs Improve Both Speed and Origin Load
CDNs deliver two distinct benefits that are sometimes conflated: reduced latency, since content is served from a point of presence geographically closer to the requesting user rather than a single distant origin server, and reduced origin load, since cached content served directly from an edge location never needs to reach the origin server at all. This second benefit matters as much as the first for high-traffic sites, since it means origin infrastructure can be sized for a fraction of total traffic — only cache misses and dynamic, non-cacheable requests actually reach it — which is often the difference between a viral traffic spike being a non-event versus an outage. Modern CDNs like Cloudflare and Amazon CloudFront have also expanded well beyond static asset caching into edge compute, running application logic directly at edge locations for use cases like personalization or A/B testing without a round trip to origin.
Historical figures and technical concepts for informational purposes only. Not technical, professional, legal, or financial advice. Sources: Official Documentation.