Back to Blog

Your website is hosted on a server somewhere. Maybe it’s in Virginia, maybe it’s in Texas, maybe it’s in a data center in Germany. When someone in California visits your site, their browser sends a request to that server, the server processes it, and the data travels back across the internet to California. That round trip takes time. The farther the visitor is from your server, the longer it takes.

A Content Delivery Network eliminates most of that distance problem. We set up CDNs for nearly every site we build, and the speed improvements are real and measurable. Here’s how it all works. Anyone starting from scratch will get more out of everything that goes into real website performance work.

What a CDN Is (Simple Version)

Imagine you own a pizza shop in downtown Edwardsville. Every customer has to drive to your single location to pick up their order. Customers across town wait longer because of the drive. Now imagine you open five satellite locations across the metro area that keep your most popular pizzas ready to go. Customers get served from whichever location is closest to them.

A CDN does exactly this for your website. Instead of serving every visitor from your single origin server, a CDN copies your website’s static files (images, stylesheets, JavaScript, fonts) to dozens or hundreds of servers distributed around the world. When someone visits your site, they receive those files from the nearest CDN server, called an “edge server,” instead of your origin server.

The result: faster load times for every visitor, regardless of where they are.

How Edge Servers and Geographic Distribution Work

CDN providers operate networks of edge servers (also called Points of Presence, or PoPs) in data centers across the globe. Cloudflare, for example, has servers in over 300 cities. When you put your site behind a CDN, here’s what happens:

  1. A visitor in Chicago requests your homepage.
  2. The CDN checks if the nearest edge server (in Chicago) already has a cached copy of your files.
  3. If yes, the files are served instantly from Chicago. This is called a “cache hit.”
  4. If no, the edge server fetches the files from your origin server, serves them to the visitor, and stores a copy for future requests. This is a “cache miss,” and it only happens once per file per edge location.

After the initial cache miss, every subsequent visitor near that edge server gets the cached version. The origin server barely has to do any work.

What This Means in Practice

  • A visitor in London gets your images from a London edge server, not from your hosting provider in Dallas.
  • A visitor in Tokyo gets files from a Tokyo edge server.
  • A visitor in your own city still benefits because the edge server is typically in a high-performance data center with optimized network routes.

The latency reduction is significant. Serving a file from 50 miles away instead of 1,500 miles away can cut load times by 100-300 milliseconds per request. When a page loads 30-50 resources, those savings compound.

Core Web Vitals translate engineering effort into search visibility.
Core Web Vitals translate engineering effort into search visibility.

What Content Should You Serve via CDN?

Not everything on your website needs to go through a CDN. Here’s the breakdown:

Ideal for CDN Delivery

  • Images. This is the biggest win. Images are large files that don’t change often. Serving them from edge servers dramatically reduces load times, especially for image-heavy pages like portfolios, galleries, and product listings.
  • CSS files. Your stylesheets are static and identical for every visitor. Perfect CDN candidates.
  • JavaScript files. Same logic as CSS. Libraries like jQuery, React bundles, and utility scripts should all be served from the edge.
  • Web fonts. Font files are surprisingly large (often 50-200KB each) and are render-blocking by default. CDN delivery reduces the time to first meaningful paint.
  • Video files. If you host your own video (rather than embedding YouTube or Vimeo), a CDN is essential. Streaming video from a distant origin server is a terrible user experience.
  • PDF documents. Menus, brochures, spec sheets, and any downloadable documents benefit from CDN delivery.

Not Ideal for CDN Delivery

  • Dynamic content. User dashboards, shopping carts, personalized pages, and anything that changes per user shouldn’t be cached at the edge (though some CDNs offer edge computing for this).
  • API responses. Real-time data from your backend typically needs to hit the origin server, though caching strategies exist for semi-static API data.
  • Admin panels. Your WordPress admin, CMS backend, or any authenticated area should bypass the CDN cache.

Popular CDN Options Worth Considering

You don’t need an enterprise budget for a CDN. Here are the options we recommend depending on the project:

Cloudflare (Free Tier)

Cloudflare’s free tier is genuinely excellent. It includes CDN delivery, DDoS protection, SSL certificates, and basic performance optimization. For most small to medium local business websites, the free tier is all you need.

Pros
Free, easy setup (DNS-level, no server config needed), includes security features, excellent global network
Cons
Free tier has limited page rules and analytics, no image optimization on the free plan
Best for
Small business websites, blogs, informational sites

We use Cloudflare’s free tier for the majority of our local business clients. It’s the best value in web infrastructure.

BunnyCDN

BunnyCDN is a pay-as-you-go CDN that’s remarkably affordable. Pricing starts at $0.01 per GB for North American and European traffic. For a local business website serving 50,000 pageviews per month, you’re looking at $1-3 per month.

Pros
Extremely affordable, fast global network, excellent image optimization (Bunny Optimizer), simple dashboard
Cons
No free tier, fewer ancillary features than Cloudflare
Best for
Image-heavy sites, e-commerce, sites needing granular cache control

AWS CloudFront

Amazon’s CDN is the go-to for larger applications, e-commerce platforms, and sites already running on AWS infrastructure. It integrates seamlessly with S3, EC2, and Lambda.

Pros
Deep AWS integration, edge computing with Lambda@Edge, highly configurable, generous free tier (1TB per month for the first year)
Cons
Complex pricing, steep learning curve, overkill for simple sites
Best for
Web applications, e-commerce platforms, sites on AWS infrastructure

Setup Basics

The setup process varies by CDN provider, but the general steps are similar:

DNS-Level CDN (Cloudflare)

  1. Create an account and add your domain.
  2. Cloudflare scans your existing DNS records.
  3. Update your domain’s nameservers to point to Cloudflare.
  4. Cloudflare automatically proxies traffic through its network.
  5. Configure page rules and caching settings.

This approach routes all traffic through the CDN and is the simplest to set up. The entire process takes about 15 minutes, plus DNS propagation time (usually under an hour).

Origin-Pull CDN (BunnyCDN, CloudFront)

  1. Create a pull zone pointed at your origin server.
  2. The CDN gives you a URL (like yoursite.b-cdn.net).
  3. Update your site to serve static assets from the CDN URL, or use a CNAME record to map a subdomain like cdn.yourdomain.com.
  4. Configure cache settings and headers.

This approach gives you more control over what goes through the CDN but requires more configuration.

Cache Headers and Invalidation

Caching is the whole point of a CDN, but you need to control it properly. Cache headers tell the CDN how long to keep files before checking the origin for updates.

Key Cache Headers

  • Cache-Control: max-age=31536000. Cache this file for one year. Use this for versioned assets (files with a hash in the filename, like styles.a3f8b2.css).
  • Cache-Control: max-age=86400. Cache for 24 hours. Good for files that change occasionally.
  • Cache-Control: no-cache. Always check with the origin before serving. The CDN still stores the file but validates it on every request.
  • Cache-Control: no-store. Don’t cache at all. Use for dynamic or sensitive content.

Cache Invalidation

When you update your website, you need the CDN to serve the new version, not the cached old version. There are three approaches:

  • Cache busting with file versioning. Change the filename when the content changes (e.g., styles-v2.css or styles.a3f8b2.css). The CDN treats it as a new file. This is the best approach.
  • Purge the cache. Most CDNs let you purge specific files or the entire cache through their dashboard or API. Use this sparingly.
  • Set shorter TTLs. If your content changes frequently, use shorter cache durations. The tradeoff is more origin requests.

We use file versioning as our primary cache strategy and reserve manual purges for emergency fixes.

Real Speed Improvements

Here’s what we actually measure when adding a CDN to local business websites:

Time to First Byte (TTFB)
Typically drops from 400-800ms to 50-150ms for cached pages. This is the most dramatic improvement.
Largest Contentful Paint (LCP)
Usually improves by 0.5-1.5 seconds, depending on image sizes and the visitor’s location.
Total page load time
Average reduction of 30-50% for first-time visitors, more for repeat visitors with browser caching.
Core Web Vitals scores
Most sites see meaningful improvement in all three Core Web Vitals metrics after CDN implementation.

For a local restaurant website we optimized, adding Cloudflare dropped the homepage load time from 4.2 seconds to 1.8 seconds. The images were the biggest factor: the site had 15 high-quality food photos on the homepage, and serving them from edge servers cut the image load time in half.

When You Don’t Need a CDN

A CDN isn’t always necessary. Here are situations where it might not move the needle:

  • Your audience is entirely local. If 95% of your traffic comes from the same metro area and your server is nearby, the geographic distribution benefits are minimal. You’ll still get some improvement from the CDN’s optimized infrastructure, but it’s less dramatic.
  • Your site is already fast. If you’re running a lightweight static site with optimized images and your TTFB is already under 200ms, a CDN adds complexity without proportional benefit.
  • You have very low traffic. If you get 500 visits per month, the performance gains won’t impact your business metrics meaningfully. Focus on other optimizations first.
  • Your site is highly dynamic. If nearly every page is personalized and uncacheable, a CDN’s core benefit (caching) doesn’t apply. You might still benefit from DDoS protection and SSL, but those aren’t CDN-specific.

That said, given that Cloudflare’s free tier costs nothing and takes 15 minutes to set up, the threshold for “worth doing” is pretty low. Even sites that don’t strictly need a CDN benefit from the security and SSL features.

The Bottom Line

A CDN is one of the highest-impact, lowest-effort performance improvements you can make to a website. For local businesses, the combination of faster load times, better Core Web Vitals scores, and improved security makes it a no-brainer, especially when options like Cloudflare make it free.

The key is proper configuration. A misconfigured CDN can cause stale content, broken functionality, or security issues. Set your cache headers correctly, use file versioning for static assets, and test thoroughly after setup.

Keep Reading

Delivery speed is only half the story; the code you deliver matters just as much. The Hot Dog Business Growth case study shows what shipping lean, hand-coded pages does for a small business.

About the Author

Brian Hunter is the founder of Hunter Creative Media & Design, an Aurora, IL studio building hand-coded websites and custom web applications for small businesses across Chicago’s western suburbs. He writes about web performance, local SEO, and the software that runs small businesses. Get in touch.