CDNs Explained: How Content Delivery Networks Speed Up Your Site
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:
- A visitor in Chicago requests your homepage.
- The CDN checks if the nearest edge server (in Chicago) already has a cached copy of your files.
- If yes, the files are served instantly from Chicago. This is called a “cache hit.”
- 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.

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.
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.
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.
Setup Basics
The setup process varies by CDN provider, but the general steps are similar:
DNS-Level CDN (Cloudflare)
- Create an account and add your domain.
- Cloudflare scans your existing DNS records.
- Update your domain’s nameservers to point to Cloudflare.
- Cloudflare automatically proxies traffic through its network.
- 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)
- Create a pull zone pointed at your origin server.
- The CDN gives you a URL (like
yoursite.b-cdn.net). - Update your site to serve static assets from the CDN URL, or use a CNAME record to map a subdomain like
cdn.yourdomain.com. - 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.cssorstyles.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:
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
- Schema Markup for Local Businesses: A Beginner’s Guide
- Building Appointment Booking Systems That Don’t Rely on Third-Party Tools
- Caching Strategies That Make Your Website Feel Instant
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.