CDNs
Copies of your content cached close to your users.
3 technologies on this page ↓How it works
A content delivery network runs hundreds of edge locations around the world. Users connect to the nearest one. If it has a cached copy of the file it answers immediately; if not, it fetches from your origin once and keeps the copy for everyone nearby. CDNs also absorb traffic spikes and attacks and terminate TLS at the edge.
A bookstore chain stocking bestsellers in every local branch instead of shipping each copy from the central warehouse.
Reach for it when
- Static assets: JavaScript, CSS, images, video
- Global audiences far from your origin region
- Shielding your origin from spikes and DDoS attacks
Think twice when
- Highly personalized responses that can’t be cached, unless you add edge compute
- Content that must change everywhere instantly, since invalidation takes time
A real example
A web app’s origin is in Virginia, roughly 150 ms from Tokyo for every round trip. A user in Tokyo loads the 2 MB JavaScript bundle from a nearby Tokyo edge instead, and the origin serves one request instead of millions.
Technologies
Specific products, and what each does differently.
Amazon CloudFrontAWSAWS’s CDN: more than 750 edge locations that cache your S3 files and front your load balancers and APIs. Amazon CloudFront | Managed service on AWS | Amazon Web Services | Proprietary | 2026-10-05 |
| Commercial product | Cloudflare, Inc. | Proprietary | 2026-10-05 | |
| Commercial product | Cloudflare, Inc. | Proprietary | 2026-10-12 |
What each provider calls it
- AWS
- CloudFront
- Google Cloud
- Cloud CDN
- Azure
- Front Door
- Open source & others
- Varnish; also Cloudflare, Fastly, Akamai
See it in a real stack
Architectures that use cdns
In code · http
# Headers from the origin tell every edge how long to cache
HTTP/1.1 200 OK
Content-Type: application/javascript
Cache-Control: public, max-age=31536000, immutable
ETag: "app.9f2c1e.js"Often confused with
Where it came from1997–2025
In the mid-1990s a website lived on one server or a small cluster, and every visitor in the world went there. When a site suddenly became popular it was swamped, and the traffic congested the network around it. A 1997 MIT paper listed famous cases: NASA JPL’s site after comet Shoemaker-Levy 9 struck Jupiter, and IBM’s during the Deep Blue–Kasparov chess match, where users were denied access for hours or even days. Shared proxy caches helped, but the more users shared one, the more likely it was to be swamped itself.
Tim Berners-Lee challenged colleagues at MIT to find a better way to deliver web content. Professor Tom Leighton and his student Danny Lewin worked on the problem, and their paper introduced consistent hashing to spread cached copies over many servers. They founded Akamai in August 1998 and launched its commercial service in April 1999, with Yahoo! as a charter customer. Content owners paid Akamai to keep copies on servers spread across many networks, and Akamai’s DNS sent each user to a nearby one.
Cloud providers later made CDNs self-service: Amazon CloudFront (2008) with pay-as-you-go pricing, and Cloudflare (2010) with a free plan. Today’s CDNs also terminate TLS, absorb DDoS attacks and run code at the edge.
Why it’s built this way
- Copies near users, not one bigger origin
- Distance and congested links between networks were the problem, so adding origin capacity didn’t help a user on another continent. Serving from inside or near the user’s network shortens every round trip.
- Consistent hashing to place content
- Each object maps to a server in a way that barely changes when servers join or fail, so caches don’t all reshuffle and no server needs a full view of the network.
- Steer users with DNS, and later anycast
- Answering the DNS lookup with a nearby server’s address works with every browser unchanged. Newer networks such as Cloudflare announce the same IP addresses everywhere and let internet routing pick the closest site.
- Let the origin’s HTTP headers decide
- The CDN can’t know how fresh content must be, so the origin says so with headers like
Cache-Control. That’s why invalidation takes effort: copies live until they expire or you purge them.
Timeline
- 1997
MIT paper introduces consistent hashing to relieve web hot spots
- 1998
Akamai incorporated on 20 August
- 1999
Akamai’s commercial service launches in April, with Yahoo! as a charter customer
- 2008
Amazon CloudFront offers a CDN with no contract, billed per GB
- 2010
Cloudflare launches, with a free plan
- 2017
Edge code goes mainstream: Lambda@Edge is generally available, Cloudflare Workers announced
- 2025
CloudFront adds flat-rate plans with no overage charges
- Karger, Lehman, Leighton, Levine, Lewin, Panigrahy: Consistent Hashing and Random Trees (STOC 1997)
- Akamai: Company history
- Leighton and Lewin (MIT): US patent 6,108,703, Global hosting system (filed 1999)
- AWS What’s New: Announcing Amazon CloudFront (Nov 2008)
- Cloudflare blog: Cloudflare’s commitment to free (free tier since launch on 27 September 2010)
- Cloudflare blog: A Brief Primer on Anycast (Oct 2011)
- AWS What’s New: Lambda@Edge generally available (Jul 2017)
- Cloudflare blog: Introducing Cloudflare Workers (Sep 2017)
- AWS What’s New: CloudFront flat-rate pricing plans with no overages (Nov 2025)
- Wikipedia: Akamai Technologies
Sources10
- CloudFront docs: What is Amazon CloudFront? (edge locations and origins)
- CloudFront docs: How CloudFront delivers content
- CloudFront docs: Invalidate files
- Amazon CloudFront features: TLS, DDoS protection and edge compute
- Google Cloud docs: Cloud CDN overview
- Microsoft Learn: What is Azure Front Door?
- Varnish Cache: Introduction
- RFC 9111: HTTP Caching (Cache-Control, max-age, public)
- RFC 8246: HTTP Immutable Responses
- WonderNetwork: Ping times from Tokyo to Washington · archived copy, original