ENHEIT

payless.host

What a CDN Does, and When a Site Needs One

Updated Nov 22, 2026

What a CDN is

A content delivery network stores copies of your site's files — images, stylesheets, scripts — on servers around the world. When someone visits from Sydney, they load from Sydney. When someone visits from Stockholm, they load from Stockholm. The content travels a shorter distance, so the page loads faster.

Your hosting server still runs the site. The CDN sits in front of it and serves the static files. Dynamic content — database queries, login sessions — still comes from your origin server.

When you need one

Most small sites do not. A CDN helps when visitors are spread across continents and speed matters enough to pay for it. An audience concentrated in one region loads faster from a well-chosen host in that region than from a CDN with a distant origin server.

The test: open your site from a location far from your server. If images take multiple seconds to appear or the layout shifts as assets load, a CDN may help. If the site feels slow everywhere, the origin server is the problem and a CDN will not fix it.

Step 1: Choose a CDN provider

Cloudflare offers a free tier that covers most small sites. It caches static files and routes traffic through its network without charging for bandwidth. Paid plans start around $20 per month and add features most sites never use.

AWS CloudFront and Cloudflare's paid tiers suit sites with high traffic or specific technical needs. Pricing is by bandwidth: you pay for what you serve. Check your current monthly bandwidth before committing — a site serving 500GB a month pays materially more than one serving 50GB.

Step 2: Point your domain to the CDN

Every CDN gives you nameservers to enter in your domain registrar's control panel. Namecheap charges 6.79 USD per year for .com domains under the NEWCOM679 offer, the same price at renewal. Log into your registrar, find the nameserver settings, and replace what is there with what the CDN gave you.

Changes take up to 48 hours to propagate, though most complete in under an hour. Your site stays live during this: the old nameservers keep working until the new ones take over.

Step 3: Configure caching rules

The CDN needs to know what to cache and for how long. Images and stylesheets can be cached for weeks. HTML pages should usually be cached for minutes, not hours, so changes appear quickly.

In Cloudflare, create a page rule for static assets: `*example.com/*.jpg`, `*example.com/*.css`, `*example.com/*.js`. Set cache level to "Cache Everything" and edge cache TTL to one month. Create a second rule for HTML with a TTL of one hour. Order matters: specific rules go above general ones.

Step 4: Purge the cache when you update

Changes to your site — new images, edited pages — will not appear until the cached version expires or you purge it manually. Every CDN has a purge function. Use it after major updates.

Purge by URL for single-file changes, purge everything after redesigns or significant edits. The next visitor after a purge triggers a fresh cache: the CDN fetches the latest version from your origin server and serves that copy until the TTL expires again.

What can go wrong

Mixed content warnings appear when your origin serves HTTPS but the CDN tries to load assets over HTTP. Check that SSL is set to "Full" or "Full (strict)" in the CDN's settings, not "Flexible".

Infinite redirects happen when both your server and the CDN try to force HTTPS. The server sees an HTTP request from the CDN, redirects to HTTPS, and the CDN redirects again. Set the CDN to "Full" SSL mode and disable HTTPS redirects on your origin server — let the CDN handle it.

Cached login pages lock users out. Set page rules to bypass cache for `/wp-admin/*`, `/login`, `/checkout`, and any URL that handles user sessions.

How to check it worked

Open your browser's developer tools, reload the page, and check the Network tab. Look for the `CF-Cache-Status` header (on Cloudflare) or equivalent. "HIT" means the file came from the CDN. "MISS" means it fetched from your origin server. The first load after a purge shows MISS; subsequent loads should show HIT.

Run a speed test from a distant location. If the improvement is under half a second, the CDN is working but the gain is marginal. If there is no improvement, your origin server is the bottleneck.

The providers in this article