Skip to content

CDN

A content delivery network (CDN) is a geographically distributed network of proxy servers that cache static and dynamic content close to users, reducing latency and origin load by serving requests from the nearest edge location.

Definition

What it is

A CDN is a reverse proxy at planetary scale. When a user requests an image, a CSS file or an API response, DNS routes the request to the nearest CDN edge node. If the node has the content (a cache hit), it serves it directly, in milliseconds. If not (a cache miss), it fetches from the origin server, caches a copy, and serves it. Subsequent users in that region get the cached copy.

Examples: Cloudflare, Akamai, Fastly, AWS CloudFront, Bunny.net, Google Cloud CDN. All offer the same fundamentals: edge caching, TLS termination, DDoS mitigation, and origin shielding.

Why it matters

Light in fiber travels at ~200,000 km/s. A request from Sydney to a server in Frankfurt takes ~150 ms round-trip. From a CDN edge in Sydney, it takes ~5 ms. That is a 30× improvement, purely from physics. The CDN also absorbs DDoS traffic, reduces origin bandwidth costs, and keeps the site up when origin fails (if configured to serve stale).

CDN vs reverse proxy vs load balancer

Aspect

CDN

Reverse Proxy

Load Balancer

Scope

Global, edge nodes

Single region

Single region

Primary role

Cache + latency

Cache + routing

Distribute traffic

TLS

Yes

Yes

Often

Example

Cloudflare

Nginx, Varnish

HAProxy, AWS ALB

How a CDN serves a request

sequenceDiagram
  participant U as User
  participant E as CDN Edge
  participant O as Origin
  U->>E: GET /img.jpg
  E->>E: Cache hit?
  alt Hit
      E-->>U: 200 OK (cached)
  else Miss
      E->>O: GET /img.jpg
      O-->>E: 200 OK
      E->>E: Cache
      E-->>U: 200 OK
  end

Timeline

  1. 1995 — MIT researchers propose "content delivery" to solve the "hot spot" problem.

  2. 1998 — Akamai launches the first commercial CDN.

  3. 2008 — Amazon CloudFront launches.

  4. 2009 — Cloudflare launches with free tier.

  5. 2018 — Cloudflare Workers introduces edge compute.

  6. 2024 — Edge compute standard: Vercel Edge, Deno Deploy, Fastly Compute@Edge.

How to use a CDN well

A CDN that helps, not hurts

  1. Cache-Control is the contract

    public, max-age=31536000, immutable for hashed assets. no-store for private data. The CDN obeys the header.

  2. Versioned URLs

    /app.css?v=1234 or /app.a1b2c3.css. When you deploy, the URL changes, the CDN sees a new resource.

  3. Purge by tag, not by URL

    Tag assets with their deployment ID. purge tag:release-42 is instant; purging URL-by-URL takes minutes.

  4. Stale-while-revalidate

    Serve stale content while fetching fresh in the background. Users never wait; the cache updates on its own.

Common failures

Origin

In 1995, Tim Berners-Lee and MIT researchers identified the "hot spot" problem: a single popular URL could overwhelm the origin. The solution was a content delivery network: replicate content to edge nodes. Akamai, founded by Tom Leighton and Danny Lewin, launched the first commercial CDN in 1998. Cloudflare, founded in 2009, offered free tiers, expanding the market. Today, "CDN" is standard infrastructure.

A CDN is a system of distributed servers that deliver pages and other web content to a user, based on the geographic locations of the user, the origin of the webpage and the content delivery server.

— Cloudflare, *What is a CDN?*, 2024
1995 · MIT propone "content delivery"
1998 · Akamai lanza el primer CDN
2010 · Cloudflare populariza
2018 · Edge compute (Workers)

Evidence

FAQ

CDN vs reverse proxy?

A reverse proxy is a single cache; a CDN is a globally distributed network of caches.

Does a CDN help SEO?

Yes: faster sites rank better, and CDNs improve uptime.

How to purge?

By URL, by tag, or by wildcard. Tag is best: a single API call clears everything for a release.

CDN for dynamic content?

Yes, via edge compute (Cloudflare Workers, Vercel Edge). Dynamic requests can run at the edge.

Connections

Etymology

Origin: acronym

  • C (noun): Content
  • D (noun): Delivery
  • N (noun): Network

Semantic network

CDNperformancnetworkingCacheLatencyedge-compureverse-pr

● broader ● narrower ● related

Broader

  • performance
  • networking

Related

Used in the garden

Sources