If your server sits in one physical location, a visitor nearby gets a fast response, and a visitor on the other side of the planet pays for every one of those extra thousands of kilometers in round-trip latency — physics doesn't negotiate. A Content Delivery Network exists to make that distance mostly irrelevant.
The basic idea
A CDN is a network of servers ("edge locations" or "points of presence") distributed around the world, each holding a cached copy of your static content. Instead of every visitor's request traveling all the way to your origin server, it's served from whichever edge location is geographically closest to them — often cutting response time dramatically for anyone far from your origin.
What actually gets cached
- Images, videos, and other media files.
- CSS and JavaScript bundles.
- Fonts.
- Increasingly, entire HTML pages for content that doesn't change per-request.
Beyond raw speed
A CDN isn't only about latency. It also absorbs traffic spikes (a sudden surge hits the edge network, not your origin server directly), provides a layer of DDoS resilience, and reduces load on your origin server since cached requests never reach it at all. Many CDNs bundle in automatic image optimization and modern format conversion (WebP, AVIF) as well, on top of pure geographic caching.
Cache invalidation: the part people underestimate
The hardest problem in caching isn't storing the copy — it's knowing when it's stale. Update an image or deploy new CSS, and every edge location holding the old cached version needs to either expire it on a schedule or be explicitly told to purge it. Getting this wrong shows up as "I updated the site but it still looks old" — usually a caching configuration issue, not a deployment failure.
A CDN doesn't make your server faster — it makes distance stop being the reason your server feels slow.
Where it fits in a modern stack
Modern hosting platforms for frameworks like Next.js typically include CDN behavior by default — static assets and even server-rendered pages get distributed to edge locations automatically, with no separate CDN service to configure. For anything not on such a platform, a CDN in front of your static assets (and ideally your entire site) is one of the highest-leverage performance changes available, and one of the cheapest to set up.

