What is a CDN
A CDN (Content Delivery Network) is a network of servers distributed across many geographic locations that caches and serves content from the server closest to the user.
How it works
When a user in Singapore requests an image from a website hosted in Virginia, a CDN serves the image from a server in Singapore (an edge server or point of presence) instead of routing the request across the Pacific. The first request fetches from the origin and caches at the edge. Subsequent requests from the same region are served from the edge cache.
CDNs use DNS to route users to the nearest edge server. Cache behavior is controlled by HTTP headers (Cache-Control, ETag) and CDN-specific configuration rules.
Where it is used
Cloudflare, CloudFront (AWS), Fastly, and Akamai are major CDN providers. CDNs serve static assets (images, CSS, JavaScript), API responses, and increasingly dynamic content with short TTLs.
Why it matters
CDNs reduce latency (content is physically closer to the user), reduce origin load (edge servers handle most requests), and improve availability (if the origin is down, the edge may still serve cached content). For global applications, a CDN is essential.
For how CDNs fit into the caching stack, see How Caching Works.