What Is a CDN (Content Delivery Network)?

A CDN is a geographically distributed network of servers that cache and deliver content from a location physically closer to each user, reducing latency comp...

Published October 7, 2026

A CDN is a network of servers around the world that caches copies of your files close to users, so pages, images and scripts load faster and your origin server does less work.

The concept

When a user requests a file, DNS routes them to the nearest edge server. If the edge has a cached copy it responds immediately; otherwise it fetches from your origin and caches it.

Cache-Control headers decide how long content stays cached. CDNs also absorb traffic spikes and DDoS attacks.

Edge vs origin

requestcache missUserMumbaiCDN edgecacheOriginyour server
The nearby edge answers, the origin is only asked on a miss.

Practical examples

Cache headers

Cache-Control: public, max-age=31536000, immutable

Fingerprinted asset names

/assets/app.9f3c1a.js   # new name on every build → safe to cache forever

Purge after a change

curl -X POST https://api.cloudflare.com/client/v4/zones/ZONE/purge_cache -H 'Authorization: Bearer TOKEN' -d '{"purge_everything":true}'

Common mistakes

  • Caching HTML with long max-age and serving stale pages.
  • Not versioning static file names.
  • Caching personalised responses.

Key takeaways

  • CDNs serve cached copies from nearby edges.
  • Control caching with headers.
  • Fingerprint static assets.

FAQ

Popular CDNs?

Cloudflare, Fastly, Amazon CloudFront, Akamai.

Does a CDN help dynamic content?

It can accelerate connections and cache short-lived responses.

More General articles