Content Delivery Networks
A Content Delivery Network (CDN) is a geographically distributed network of edge servers that cache and serve content from locations close to end users, reducing latency and offloading origin servers.
A CDN places copies of your content (images, videos, JS, API responses) on servers around the world — called Points of Presence (PoPs) or edge nodes. When a user requests content, DNS routes them to the nearest PoP. If the PoP has the content cached, it serves it directly (cache hit); otherwise, it fetches from the origin server, caches it, and serves it (cache miss). Major CDNs include Cloudflare (300+ cities), Akamai (4,100+ PoPs), and AWS CloudFront (600+ PoPs).
Tradeoffs
Strengths
- Dramatic latency reduction: Serving from a nearby edge node is 10–30x faster than a cross-continent origin fetch.
- Origin offload: 90–99% cache hit rates reduce origin infrastructure costs.
- DDoS protection: Distributed architecture absorbs attacks that would overwhelm a single data center.
- Global reach: Instantly serve users worldwide without deploying origin infrastructure in every region.
- TLS acceleration: Handshakes at the edge save hundreds of milliseconds per new connection.
Weaknesses
- Cache invalidation complexity: Purging stale content across hundreds of PoPs takes time (seconds to minutes) and requires careful coordination.
- Cost: CDN bandwidth charges add up at scale (Cloudflare and CloudFront charge $0.01–0.08/GB depending on region).
- Dynamic content limitations: Highly personalized or real-time content benefits less from CDN caching.
- Debugging difficulty: Cached content can mask origin issues; cache-related bugs are hard to reproduce.
- Vendor lock-in: CDN-specific features (Workers, Lambda@Edge) create switching costs.
- Cold cache penalty: After a purge or new deployment, the first request to each PoP experiences origin latency.
Likely Follow-Up Questions
- How would you handle cache invalidation for a CDN serving millions of edge nodes?
- What is the difference between push-based and pull-based CDN architectures?
- How does a CDN handle dynamic, personalized content?
- When would you use a multi-CDN strategy?
- How do CDNs use Anycast for routing and DDoS protection?
- What HTTP headers control CDN caching behavior?
Source: editorial — Synthesized from Cloudflare, Akamai, and AWS CloudFront documentation, Netflix Open Connect publications, and HTTP caching specifications.