CDN: Content Delivery Networks Explained

A CDN (Content Delivery Network) is a geographically distributed network of edge servers that cache content close to users, reducing latency and offloading origin servers. When a user requests an asset, the nearest point of presence (PoP) serves it. CDNs handle static files, video, and increasingly dynamic content via edge compute.

What a CDN Does

A CDN caches copies of your content on edge servers spread across hundreds of locations (points of presence, or PoPs) worldwide. When a user in Tokyo requests an image hosted in Virginia, the CDN serves it from a Tokyo PoP instead, cutting round-trip latency from ~150ms to single-digit milliseconds and reducing load on your origin.

CDNs primarily accelerate static, cacheable content: images, CSS/JS bundles, fonts, videos, and downloads. They also provide DDoS protection, TLS termination, compression, and increasingly run code at the edge (Cloudflare Workers, AWS Lambda@Edge, Fastly Compute) to personalize or assemble responses near users.

How CDNs Route and Cache

Most modern CDNs use anycast: the same IP address is announced from many PoPs, and BGP routes each user to the topologically nearest one. Older/DNS-based CDNs use GeoDNS to return a nearby edge IP. Either way, requests land at a close edge.

Caching uses pull (lazy) or push models. In a pull CDN (the default), the edge fetches from origin on the first miss, caches it per the Cache-Control/TTL headers, and serves subsequent hits locally. In a push CDN, you proactively upload content to edges, useful for large infrequently changing files. Cache freshness is controlled by Cache-Control, Expires, and ETag/Last-Modified for revalidation.

AspectPull CDNPush CDN
PopulationOn first request (miss)Proactively uploaded
Origin loadHigher on cold cacheLower
Best forLarge catalogs, web assetsLarge static files, releases
ManagementLow (automatic)Higher (manual sync)

Invalidation and Dynamic Content

Stale content is the classic CDN problem. Two main strategies: cache busting (version the URL, e.g., app.a1b2c3.js, so new content has a new key) and purging/invalidation (tell the CDN to evict a path). Cache busting is preferred because purges propagate slowly across PoPs. Long TTLs plus versioned URLs give the best of both.

Dynamic, personalized content is harder to cache. Techniques include caching at fine granularity, edge-side includes (ESI), micro-caching (caching for even 1 second cuts origin load dramatically under high traffic), and running logic at the edge. Truly user-specific responses bypass the cache and proxy to origin, where the CDN still helps via optimized connections and TLS.

Providers and Real Use

Major CDNs include Cloudflare, Akamai (the pioneer, founded 1998), Amazon CloudFront, Fastly, and Google Cloud CDN. Netflix runs its own CDN (Open Connect) with appliances placed inside ISPs to serve the bulk of its video traffic. CDNs collectively carry a large share of all internet traffic and are essential for global web performance and resilience.

ResuMax tailors your resume to each role, scores it like a recruiter, and preps you for interviews.

Practice with the interview coach

Frequently asked questions

What's the difference between a CDN and a cache?

A cache is a general concept of storing data for fast reuse. A CDN is a specific, geographically distributed network of caching edge servers that bring content physically closer to users, reducing latency and offloading the origin. A CDN is essentially a global, multi-location cache.

Pull vs push CDN: which should I use?

Use a pull CDN (default) for most web assets, edges fetch from origin on first miss automatically. Use a push CDN when you have large, infrequently changing files (software releases, big media) and want to avoid cold-cache origin hits and control exactly what's cached.

How do you invalidate CDN content?

Either purge specific paths (slower to propagate across PoPs) or use cache busting, versioning the URL so updated content gets a new key and the old key naturally expires. Versioned URLs with long TTLs are the most reliable approach.

Can a CDN cache dynamic content?

Partially. Fully personalized responses bypass the cache, but micro-caching (caching for even 1 second), edge-side includes, and edge compute (Cloudflare Workers, Lambda@Edge) let CDNs accelerate semi-dynamic content and assemble pages near the user.

Related