What Is a CDN? Content Delivery Networks Explained
A CDN (content delivery network) is a global fleet of cache servers that store copies of your content close to users, so requests are served from a nearby location instead of your origin.
A CDN speeds up the web by putting your content physically closer to the people requesting it. Instead of every user reaching a single origin server, they hit a nearby edge node that has a cached copy. This cuts latency, reduces origin load, and absorbs traffic spikes. CloudFront, Cloudflare, and Fastly are common examples.
How a CDN serves content
On the first request for an asset in a region, the edge node fetches it from your origin and caches it. Subsequent users in that area get the cached copy directly. Cache duration is controlled by TTLs and cache-control headers you set.
What a CDN improves
- Latency, by serving from a nearby edge.
- Origin load, since the edge absorbs most requests.
- Resilience, by smoothing traffic spikes.
- Security, with HTTPS, DDoS mitigation, and WAF features.
Static vs dynamic content
CDNs excel at static assets (images, JS, CSS, videos) that many users share. Dynamic, per-user responses are harder to cache, though modern CDNs can cache at the edge with smart rules or run edge compute to personalize responses.
The cache invalidation problem
Because the edge holds copies, deploying new content means stale caches must be cleared or bypassed. Teams either issue invalidations for changed paths or use versioned (content-hashed) filenames so new files have new URLs and old caches simply expire.
Role in CI/CD
A front-end deploy uploads built assets to the origin (often object storage) and then invalidates the CDN so users see the new version. Content-hashed filenames let you cache assets forever and only invalidate the HTML entry point, which makes deploys both fast and safe.
Key takeaways
- A CDN caches content at edge servers near users to cut latency and origin load.
- It is ideal for static assets; dynamic content needs smarter caching or edge compute.
- Deploys must invalidate the cache or use versioned filenames to avoid stale content.