What is a CDN?
Discover what is a CDN and why it's useful
A CDN stands for Content Delivery Network.
It’s a series of servers distributed all around the globe, all linked together.
In the context of helping speed up a website, their job is to distribute assets (like images, JavaScript files, CSS, also HTML) so that they are reasonably near - physically - to every user that might want to access your website, in order to improve the speed of the connection and reduce the latency.
CDNs are the ultimate cache, and the cheapest way to serve content all around the world.
Visitors will never access the actual web server that hosts your files, but instead they will hit those CDN servers, helping to reduce the load.
A CDN provides
- Speed, being closer to a user’s network improves speed and reduces latency
- Redundancy, if a node of the CDN fails, other nodes can handle the traffic
- Reduced costs in bandwidth and server power compared to serving all the traffic from a centralized location that might not be optimized for serving lots of traffic
- Security by adding additional levels of protection at the CDN node level. Not all CDNs do this, but most do and also introduce DDoS attack protection mitigations
A CDN gets the original resource from an origin server, and as long as the origin does not change, it will continue serving its local copy of an asset:

Each CDN server is located in different continents, and depending on how the CDN is built, in different parts of a continent as well.
Every major company uses CDNs for serving assets, and you can too, by leveraging the services of companies like Cloudflare, Amazon CloudFront, Google Cloud CDN, Azure CDN or others.
CDNs might be integrated directly by your web hosting as well. I use Netlify for example, and they integrate an automatic CDN, which makes my site fast in every location of the world.
download all my books for free
- javascript handbook
- typescript handbook
- css handbook
- node.js handbook
- astro handbook
- html handbook
- next.js pages router handbook
- alpine.js handbook
- htmx handbook
- react handbook
- sql handbook
- git cheat sheet
- laravel handbook
- express handbook
- swift handbook
- go handbook
- php handbook
- python handbook
- cli handbook
- c handbook
subscribe to my newsletter to get them
Terms: by subscribing to the newsletter you agree the following terms and conditions and privacy policy. The aim of the newsletter is to keep you up to date about new tutorials, new book releases or courses organized by Flavio. If you wish to unsubscribe from the newsletter, you can click the unsubscribe link that's present at the bottom of each email, anytime. I will not communicate/spread/publish or otherwise give away your address. Your email address is the only personal information collected, and it's only collected for the primary purpose of keeping you informed through the newsletter. It's stored in a secure server based in the EU. You can contact Flavio by emailing [email protected]. These terms and conditions are governed by the laws in force in Italy and you unconditionally submit to the jurisdiction of the courts of Italy.