How it works
Without a CDN, every visitor fetches your pages, images and scripts from one server, say in Toronto. A visitor in Vancouver waits for each file to cross the country; one in London waits for it to cross the Atlantic. A CDN stores copies of those files on servers in dozens or hundreds of cities. The Vancouver visitor is served from Vancouver, the London visitor from London, and your server only hears from the CDN when a copy needs refreshing.
What you gain
- Speed, especially for images and for visitors outside your region. Images are usually the heaviest part of a page; see how fast a website should load.
- Resilience. Traffic spikes and many kinds of attacks hit the CDN's network instead of your single server.
- Security extras. Most CDNs include a firewall, bot filtering and free HTTPS certificates.
- Lower hosting cost. Less traffic reaching your server means a smaller plan does the job.
Do you need one?
If your customers are all within a few hundred kilometres of your server and your host is fast, a CDN is a modest gain. If you have visitors across Canada and the US, an image-heavy site, or you want the firewall and uptime protection, it is worth setting up, and Cloudflare's free plan costs nothing. Shopify, Squarespace, Wix, Vercel and many WordPress hosts already run your site through a CDN, so check before adding another. Setting one up is a DNS change; see what DNS is.
