Content Delivery Network (CDN)
A content delivery network (CDN) is a group of servers spread across many locations that store copies of a website’s files and deliver them from the location nearest each visitor. This shortens the distance data travels, making pages load faster and taking pressure off the main server.
How a CDN works
Your website lives on an origin server. With a CDN in place, visitors connect to the CDN’s nearest edge server instead. If that edge already has a cached copy of the requested file, it serves it immediately. If not, it fetches the file from the origin, sends it to the visitor and keeps a copy for the next request. Most CDNs also act as a reverse proxy, handling HTTPS, security filtering and compression on the way through.
CDNs traditionally cached static files such as images, CSS and JavaScript. Many can now cache whole HTML pages too, which has a bigger impact on speed.
Why a CDN matters for SEO
- Faster responses: serving from nearby edges cuts Time to First Byte, especially for visitors far from your host.
- Better Core Web Vitals: quicker delivery of images and HTML helps Largest Contentful Paint.
- Reliability: a CDN absorbs traffic spikes and some attacks, reducing 5xx server errors that can make Google slow its crawling.
- Modern protocols: most CDNs support HTTP/3 and Brotli compression without changes on your server.
A CDN does not boost rankings by itself. It removes speed and stability problems that can hold a site back. It also does not affect which country Google associates your site with, as that is handled through content, domains and hreflang.
Setting up a CDN
- Choose a provider. Some sit in front of your whole domain by changing your DNS; others serve assets from a separate hostname.
- Configure caching rules: long cache times for versioned static files, shorter or carefully purged rules for HTML.
- Make sure logged-in, basket and checkout pages are excluded from page caching.
- Enable HTTPS on the CDN and redirect all traffic to the secure version.
- Test that pages, forms and redirects behave as before.
- Compare speed metrics before and after launch, using field data from several countries if your audience is international.
Common pitfalls
- Blocking Googlebot: aggressive bot protection can serve challenges or errors to crawlers. Check crawl stats in Search Console after launch, and confirm genuine Googlebot is allowed.
- Stale content: forgetting to purge the cache after updates leaves old pages live.
- Duplicate hostnames: if a CDN hostname serves full pages that can be crawled, it can create duplicate content. Use canonicals or restrict it to assets.
- Ignoring the origin: a CDN hides a slow server for cached pages, but uncached pages still depend on good hosting.
- Image URLs changing: moving images to a new hostname without redirects can lose image search visibility.
Further reading: MDN’s definition of a CDN.
Key Takeaways
- A CDN serves copies of your site from servers near each visitor.
- It reduces TTFB and helps LCP, particularly for distant visitors.
- CDNs improve reliability during traffic spikes and attacks.
- A CDN removes speed problems but is not a ranking boost on its own.
- Check that bot protection does not block Googlebot after setup.
Related Terms
Wondering what to fix first on your site? Get a free check of your site’s SEO, or keep learning in the SEO Encyclopedia.