Glossary / CDN
What is a CDN (Content Delivery Network)
A CDN (Content Delivery Network) is a worldwide network of servers that keep copies of your site's files and serve them to each visitor from the nearest location. The browser fetches images and scripts from a server close by instead of one distant server, so pages load faster and your main hosting carries less load.
Check your site
When a visitor opens the site, the CDN works out where they are and serves static files (images, CSS, JS, video) from the closest node. The files are cached on the nodes, so your origin server no longer has to hand them out.
A CDN helps most when a site has visitors in several countries or a lot of heavy files. It also makes the site more resilient to traffic spikes and adds basic DDoS protection, because an attack is spread across the nodes. The best known CDNs are Cloudflare, Fastly, Amazon CloudFront and Google Cloud CDN.
Your server still builds the dynamic pages, so a CDN does not replace hosting. It speeds up the delivery of static files and cached responses.
Example
cf-cache-status: HIT
Common mistakes
- Thinking a CDN replaces hosting. It caches and serves files, while the site itself lives on your server.
- Assuming every site needs a CDN. A small site with a local audience gains little from one.
- Choosing the wrong SSL mode on Cloudflare: Flexible instead of Full causes endless redirects.
- Not purging the CDN cache after an update and then still seeing the old version.