CDN

A Content Delivery Network (CDN) is a distributed network of edge servers that cache and serve content from locations close to the user, instead of every request reaching the origin server. CDNs reduce latency, offload traffic from the origin, and improve resilience to traffic spikes and regional outages.

How it works

When a user requests an asset, DNS or anycast routing directs them to the nearest edge point of presence (PoP). If the edge has a cached copy, it serves the response directly. If not, it fetches from the origin (or another edge), caches the response according to the response's Cache-Control and Surrogate-Control headers, and serves it. Subsequent requests for the same asset within the same PoP are served from cache.

Common capabilities

  • Static asset caching: images, CSS, JS, fonts, video segments
  • Dynamic content acceleration: TCP optimisations, connection pooling, smart routing
  • Edge compute: Cloudflare Workers, Fastly Compute@Edge, AWS Lambda@Edge, Vercel Edge Functions
  • DDoS protection and WAF: filtering and rate limiting at the edge
  • Image optimisation: on-the-fly resizing, format conversion (WebP, AVIF)

Common providers

  • Cloudflare, Fastly, Akamai, AWS CloudFront, Google Cloud CDN, Azure Front Door, Bunny.net, KeyCDN
🔗
Related Terms
Caching, TTL, HTTP, AWS.

Subscribe to Sahil's Playbook

Clear thinking on product, engineering, and building at scale. No noise. One email when there's something worth sharing.
[email protected]
Subscribe
Mastodon