ORIGINEDGEEDGEEDGEEDGEEDGEEDGEEDGEEDGEcache close to users

Content Delivery Networks

10 min readWeb Technology

A Content Delivery Network is a global distributed cache that sits between users and origin servers, storing copies of static content close to wherever requests come from. CDNs power virtually every site you'd notice if it were slow — search, social, streaming, news, shopping — by trading the physics of distance for the cost of a thousand data centers.

A Content Delivery Network (CDN) is a globally distributed set of servers ("edge nodes" or "points of presence") that cache and serve content on behalf of origin web servers. When a user in Tokyo requests example.com's logo, the request hits the nearest CDN node, which serves the cached logo from local storage — never bothering the origin server in Frankfurt or Virginia. The CDN absorbs the load and reduces latency.

Why CDNs exist

Three problems CDNs solve:

  • Latency. The speed of light in fiber is finite. Tokyo to Virginia is ~140 ms one-way, ~280 ms round-trip. Loading a page with 50 round-trips means 14 seconds of just network latency. Putting the content 10 ms away makes the page instant.
  • Origin load. A site that handles 1,000 requests/second at the origin can handle 1,000,000 if 99.9% are served from CDN cache. The same hardware does dramatically more work per dollar.
  • Bandwidth cost. CDN bandwidth (especially intra-CDN peering) is cheaper at scale than origin bandwidth from cloud providers. Sites save substantially on egress costs.

What gets cached

The classic CDN caches static content — images, CSS, JavaScript, videos, fonts. These don't change per user and can be reused across millions of requests. The cache key includes the URL plus any varying headers (Vary: Accept-Encoding for gzipped content, etc.).

Modern CDNs also handle dynamic content via:

  • Edge caching with short TTLs — even 30 seconds of caching dramatically reduces origin load for popular content.
  • Edge compute (Cloudflare Workers, Fastly Compute@Edge, AWS Lambda@Edge) — run application logic at the edge, generating personalized responses without going to the origin.
  • Edge KV stores for low-latency state.
  • Streaming protocols (HLS, DASH) for video, where each chunk is cached independently.

How requests find the right edge

The two main techniques to route users to the nearest edge:

  • DNS-based steering. The CDN's authoritative DNS server returns different IP addresses depending on which resolver asked. ECS (EDNS Client Subnet) lets the CDN see the user's network, not just the resolver's. Akamai pioneered this and still uses it heavily.
  • Anycast. The same IP address is announced from many locations via BGP. Internet routing naturally sends each user to the closest one. Cloudflare and Fastly use this; it's operationally simpler than DNS steering.

What's at a CDN edge

A typical edge POP (Point of Presence) has:

  • Hundreds to thousands of physical servers
  • Petabytes of SSD storage for cache
  • Multiple uplinks to local ISPs, Internet exchanges, and the CDN's own backbone
  • TLS termination hardware so HTTPS doesn't bottleneck
  • DDoS-absorption capacity, often tens or hundreds of Gbps

The largest CDNs (Cloudflare, Akamai, Fastly, Google, Amazon CloudFront) operate hundreds of POPs across 100+ countries. Smaller CDNs cluster their POPs in major metros and rely on the public Internet for the last mile.

Beyond static delivery

Modern CDNs sell a stack of adjacent services:

  • DDoS protection — absorbing attacks at the edge instead of letting them reach the origin
  • Web Application Firewall (WAF) — filtering malicious requests
  • Bot management — distinguishing legitimate users from automated traffic
  • Image optimization — converting JPEG to WebP/AVIF on the fly, resizing, lazy-loading
  • Edge compute — application logic at the edge
  • Zero Trust access — corporate-style perimeters delivered as a SaaS

For many companies, the CDN has become more than a cache — it's the entire HTTP layer between users and their applications.

CDNs and privacy

CDNs can see all the requests that pass through them, including paths, headers, and (after TLS termination) bodies. This makes them powerful infrastructure providers — Cloudflare alone handles roughly 20% of HTTPS traffic globally. Privacy properties depend on the CDN's policies and legal jurisdictions; the data is technically available, the question is what they do with it.

For end users, the privacy effect is mixed. CDNs centralize traffic visibility (concerning) but also enable HTTPS adoption, defeat DDoS-based censorship attempts, and host major Tor onion mirrors of news organizations (positive).

Choosing a CDN

The major players in 2026:

  • Cloudflare — broadest free tier, strong DDoS protection, Workers edge compute
  • Akamai — enterprise focus, oldest in the market, premium pricing
  • Fastly — developer-friendly, instant cache invalidation, used by Stripe, GitHub, etc.
  • AWS CloudFront — bundled with the rest of AWS, good if you're already there
  • Google Cloud CDN — bundled with GCP, integrates with Google's global network
  • BunnyCDN, KeyCDN — smaller, simpler, cheaper

For most personal projects and small businesses, Cloudflare's free tier covers the bases. For high-volume applications, the choice depends on which adjacent services you need.

Frequently asked questions

Is a CDN the same as a reverse proxy?
A CDN is a globally distributed reverse proxy with caching. Conceptually they're the same architecture — both sit in front of your origin server and serve responses on its behalf. The difference is scale: a single reverse proxy is local; a CDN is everywhere.
Does a CDN affect SEO?
Indirectly, yes. Faster page loads correlate with better SEO rankings, and CDNs deliver fast page loads. Some CDNs also offer image optimization and HTTP/3 support, both of which Google rewards. The CDN itself isn't a ranking signal; the performance it enables is.
Can a CDN hide my origin server?
Yes, and many sites use them specifically for this. The origin IP can be kept secret if all incoming traffic is required to come through the CDN. Combined with origin firewall rules that allow only CDN IPs, this prevents direct attacks on the origin. Operational details (DNS records pointing at the origin, leaked SSL certs, etc.) can still expose the origin if not careful.
Why does a site sometimes load differently on different days?
CDN cache state varies. A page can be in the cache (fast) or missing (slow first load, fast second). Cache invalidation, A/B tests, and per-region content can also produce different responses. Sites often look or perform differently as a result.
What's the difference between a CDN and a website host?
A host runs the origin server where your application lives. A CDN is a layer in front of the host that caches and serves content faster. Some platforms (Vercel, Netlify, Cloudflare Pages) bundle hosting and CDN into one service.
CDN Explained: How Content Delivery Networks Make the Web Fast