Skip to content

When a CDN helps and how to add one

Best practices1 min readFixes check cdn-detected

A CDN serves files from a location near the visitor and absorbs traffic spikes. Cloudflare's free plan is enough for most sites.

Step by step, with screenshots: What is a CDN? What it fixes for speed, and what it does not →

Check your own site

Runs this check and the other 192, free, in about 45 seconds.

Or run only this check with the free Web hosting speed test, the free HTTP/2 & HTTP/3 test or the free Tech stack & CMS detector.

What it is

A CDN (content delivery network) is a network of servers in many cities that keeps copies of your site's files and serves each visitor from the location nearest to them. Cloudflare, Fastly, Bunny and Amazon CloudFront are common examples.

Distance costs time: a visitor 8,000 km from your server waits roughly 100-150 ms per round trip before anything loads, and a page needs several. A CDN cuts that for cached files, absorbs traffic spikes and often adds HTTP/3, compression and basic attack protection. Sites whose visitors all live near the server gain least.

OK looks like this: static files, and ideally cached pages, are served from a CDN edge close to your visitors. getReport detects common CDNs from response headers and notes when none is in front of the site.

What a passing site looks like

  • A CDN is in front of the siteinfo onlyeffort M

No CDN in front of the site

Why it matters. A CDN serves your files from a location near each visitor and absorbs traffic spikes. Without one, visitors far from your server wait longer for every file.

How to fix it.
  1. Put the site behind a CDN such as Cloudflare, Bunny or Fastly; the free tiers cover most small sites.
  2. At minimum, serve images and static files from a CDN hostname.

Questions people ask

What is a CDN cache?

A CDN cache is the copy of your files that a CDN's servers store at each location, so they can answer visitors without asking your own server. How long a file stays there is set by your Cache-Control headers or CDN rules. When you change a file, you purge the cache so edges fetch the new version.

What is a CDN?

A CDN, or content delivery network, is a group of servers spread around the world that deliver a website's files from the location closest to each visitor. It sits between visitors and your server, caching images, scripts, styles and often whole pages, which makes the site faster and more resilient.

Do you need a CDN for your website?

Not always. A CDN helps most when visitors come from many countries, the site has many images or files, or traffic comes in spikes. A local business whose visitors live near a fast server gains less. Since Cloudflare and others have free plans, many small sites add one for security and HTTP/3 as well.

Is a CDN good for WordPress?

Yes. A CDN serves WordPress's images, CSS and JavaScript from nearby locations and, with full-page caching, can serve whole pages without running PHP. Many managed WordPress hosts include one. Exclude the admin area, logged-in users and WooCommerce cart and checkout from page caching.

How do you check if a website uses a CDN?

Look at the response headers in the browser's Network tab: headers such as cf-ray (Cloudflare), x-served-by (Fastly), x-amz-cf-id (CloudFront) or server: BunnyCDN reveal the CDN. A DNS lookup showing a CDN's hostname works too. getReport reports the CDN it detects.

Filed under Best practices. Copy is generated from the same catalogue that scores every report, so what you read here is what the report says.