A content delivery network (CDN) is a group of servers in many locations that keeps copies of your files and serves them from the one nearest each visitor. You likely benefit from one if your visitors are spread across regions or your pages are mostly static. A small local site on a fast host can work without one.
Why it matters
Distance adds delay. A visitor far from your server waits longer for every connection and file. A CDN shortens that trip by answering from a nearby edge server, and it also takes load off your own server because repeat requests for images, scripts and styles are served from the cache.
Many CDNs also offer extras on the same network:
- TLS certificates and HTTP/2 or HTTP/3 support
- text compression such as Brotli
- protection against floods of unwanted traffic
- rules for redirects and cache headers
A CDN does not make slow code fast. If your server needs three seconds to build each page and the CDN cannot cache it, the request still travels to your origin.
How to decide
- Find where your visitors are. Search Console and your analytics show countries. If most are in one region near your host, the gain is smaller.
- Check how fast the first byte arrives from a faraway location using a testing tool, or the Time to First Byte in PageSpeed Insights.
- Look at what you serve. Static pages, images, fonts and downloadable files cache very well. Pages that differ per user cache less.
- If you choose a CDN, put it in front of your domain by following the provider's instructions, which usually involve changing DNS records or nameservers.
- Test afterwards. Confirm that pages load over HTTPS, that cache headers behave as intended and that the canonical host is unchanged.
Common mistakes
- Caching pages that include private or logged-in content.
- Forgetting to purge or version files, so visitors keep getting an old stylesheet after an update.
- Setting up the CDN and bot protection so aggressively that search engine crawlers are blocked.
- Assuming a CDN replaces image optimisation. Oversized images are still oversized.
- Changing DNS without recording the original settings first.
Frequently asked questions
Does a CDN help SEO?
Not directly. It can lower load times for visitors, which supports a better experience, but no ranking change can be promised.
Is a CDN the same as web hosting?
No. Hosting is where your site runs. A CDN sits in front and delivers cached copies. You still need hosting, called the origin.
Will a CDN change my URLs?
Normally not. Your pages keep their addresses. If you serve assets from a separate CDN host name, only those file URLs change.
Related guides
- CDN setup for SEO and performance
- Cloudflare SEO settings
- Cloudflare bot blocking and search engines
- Browser caching and Cache-Control
Want a quick look at your own site's speed? Try the free website sample.