localwebadvisor
WIKI← Wiki home

What Is a CDN (Content Delivery Network)?

By FayUpdated Jul 9, 2026EVERGREEN
⚡ THE ANSWER

A content delivery network (CDN) is a globally distributed network of servers that stores cached copies of your website's files and serves them from the location closest to each visitor. By shortening the physical distance data must travel, a CDN reduces load times, lowers Time to First Byte, and absorbs traffic spikes. CDNs also add security features like DDoS protection. They are one of the simplest, highest-impact speed upgrades for most websites.

Core benefit
Serves files from edge servers near the visitor to cut latency (industry-typical)
What it caches
Static assets: images, CSS, JavaScript, fonts, and often full HTML pages
Security bonus
DDoS mitigation, WAF, and TLS at the edge (industry-typical)
Common providers
Cloudflare, Fastly, Amazon CloudFront, Akamai

How does a CDN work? #

A CDN works by keeping copies of your website's files on many servers, called edge servers or points of presence, spread across cities and countries. When a visitor loads your site, the CDN routes their request to the nearest edge server rather than your origin server, which might be far away. If that edge already has a cached copy of the requested file, it serves it immediately without contacting your origin at all. The result is a much shorter round trip: instead of a request travelling across the country and back, it travels a few miles. This dramatically cuts latency, the delay caused by physical distance and network hops. For assets that rarely change, like images, stylesheets, and scripts, the edge can serve them for hours or days before checking with the origin again. Modern CDNs can also cache full HTML pages and run logic at the edge. This is why a CDN pairs so well with the caching described in /wiki/what-is-browser-caching, and why we build it into /services/managed-hosting.

Why does a CDN make sites faster? #

The main reason a CDN speeds up a site is distance. Data travels at a finite speed, so a visitor 2,000 miles from your server experiences noticeable latency on every request, and a page makes dozens of requests. Serving those files from an edge server a short distance away collapses that delay. A CDN also reduces load on your origin server, since the edge handles most requests, leaving your server free to build the dynamic parts of pages faster, which improves Time to First Byte as described in /wiki/what-is-time-to-first-byte. Edge servers are optimized for delivery, using fast storage, modern protocols like HTTP/3, and efficient connection reuse. During traffic spikes, the distributed network absorbs demand that would overwhelm a single server. Even for a local business serving one city, a CDN helps because it caches static files close by, uses faster infrastructure, and shields your origin. Combined with image and code optimization, it is one of the most cost-effective speed wins we deploy in /services/speed-optimization.

Do local businesses need a CDN? #

It is a fair question, since a plumber or dentist serves customers in one metro area, not worldwide. The answer is usually yes, for three reasons beyond geography. First, CDNs use faster, better-maintained infrastructure than most budget hosts, so even nearby visitors get quicker delivery. Second, the security layer matters: CDNs block malicious traffic, absorb denial-of-service attacks, and add a web application firewall, protecting small sites that cannot afford downtime. Third, CDNs improve reliability, keeping your site available even if your origin server has a hiccup, because cached pages can still be served. The geographic benefit still applies within a region too, since edge servers exist in major US cities. The main case against a CDN is added complexity or cost, but many providers offer free or low-cost tiers well suited to local sites. We evaluate the tradeoff per client and typically include a CDN in /services/managed-hosting. See how it complements /services/website-security for the protection side.

What does a CDN cache versus not cache? #

CDNs are best at caching static assets, files that are the same for every visitor and change infrequently. That includes images, CSS stylesheets, JavaScript files, web fonts, videos, and downloadable documents. These can safely live on edge servers for long periods, refreshed only when you update them, which is handled through cache-busting filenames or purge commands. Dynamic content is trickier. Pages that differ per user, such as a logged-in account area, a shopping cart, or a personalized dashboard, generally should not be cached at the edge because visitors could see each other's data. However, many CDNs can cache full HTML for pages that are identical for all visitors, like a homepage or service page, dramatically speeding delivery. The art is configuring cache rules so static and public content is cached aggressively while private and dynamic content bypasses the cache. Getting this wrong causes stale content or privacy leaks, so it needs care. Our team configures these rules during /services/speed-optimization and maintains them under /services/care-plans.

CDN and Core Web Vitals #

A CDN improves several Core Web Vitals inputs at once. By serving files from nearby edges, it lowers Time to First Byte, which in turn helps Largest Contentful Paint because rendering can start sooner. Faster delivery of the hero image or main content, often the LCP element, means it paints earlier. Because CSS and JavaScript arrive faster, the browser can process render-blocking resources sooner, reducing the delay before content appears; see /wiki/what-is-render-blocking. Modern CDNs also optimize delivery in ways that help, such as compressing responses, using HTTP/3, and in some cases converting images to efficient formats like WebP on the fly. The net effect is a measurable lift in loading metrics with relatively little effort, which is why we treat a CDN as foundational rather than optional. It will not fix a heavy, script-laden page on its own, so it complements rather than replaces the work in /services/speed-optimization. Review the full picture in /wiki/website-speed-guide.

CDN security benefits #

Modern CDNs double as a security layer, which is often as valuable as the speed gain for small businesses. Because all traffic passes through the CDN before reaching your origin, the provider can absorb distributed denial-of-service attacks that would otherwise knock a small site offline. A web application firewall inspects requests and blocks common attacks like SQL injection and cross-site scripting before they reach your server. Bot management filters out scrapers and malicious automation. The CDN also handles TLS at the edge, keeping HTTPS fast and certificates current, which supports the trust signals covered in /wiki/what-is-an-ssl-certificate. By hiding your origin server's real address, a CDN makes it harder for attackers to target your host directly. For a local business that cannot afford a breach or extended outage, these protections come bundled with the performance benefit at little extra cost. We combine CDN security with our /services/website-security service and monitor it through /services/care-plans so protection stays current as threats evolve.

How do you set up a CDN? #

Setting up a CDN is usually straightforward. The most common approach for local sites uses a reverse-proxy CDN like Cloudflare: you point your domain's DNS to the CDN, and it sits in front of your origin, caching and protecting all traffic automatically. This requires updating nameservers, a change covered in /wiki/what-is-dns and handled by our /services/domains-dns-email service. Other CDNs work by rewriting asset URLs to a CDN hostname, so images and scripts load from the edge while pages come from your origin. After connecting, you configure cache rules deciding what is cached and for how long, enable compression and modern protocols, and set up automatic cache purging when content changes. Testing is essential to confirm dynamic pages are not wrongly cached. Many WordPress hosts include a CDN with one-click activation. We handle the full setup, including DNS, cache tuning, and security rules, as part of /services/managed-hosting and /services/speed-optimization, so owners get the benefits without touching configuration.

cloudflare-cache-rules.txt — example page rules for a local business site
# Cache static assets aggressively at the edge
*.example.com/wp-content/*   -> Cache Everything, Edge TTL 7 days
*.example.com/*.css          -> Cache Everything, Edge TTL 7 days
*.example.com/*.js           -> Cache Everything, Edge TTL 7 days

# Cache public HTML pages but keep them fresh
example.com/services*       -> Cache Everything, Edge TTL 2 hours

# Never cache private or dynamic areas
example.com/cart/*           -> Bypass Cache
example.com/my-account/*     -> Bypass Cache
example.com/wp-admin/*       -> Bypass Cache

CDN limits and common mistakes #

A CDN is powerful but not a cure-all, and misconfiguration causes real problems. The most common mistake is caching pages that should be dynamic, so visitors see stale prices, another user's cart, or an outdated announcement. The reverse mistake, caching nothing, wastes the CDN entirely. Aggressive caching without proper purge rules leaves customers seeing old content after you publish updates. A CDN also cannot fix a fundamentally slow origin for uncached dynamic requests, nor can it rescue a page bloated with heavy JavaScript, which still runs on the visitor's device regardless of how fast files arrive. Some free tiers add limitations or occasional latency for cache misses. Finally, routing all traffic through a third party means an outage at the CDN can affect your site, though major providers are highly reliable. The takeaway is that a CDN is one layer in a performance stack, most effective alongside good hosting, image optimization, and lean code. We size and configure it correctly through /services/speed-optimization rather than treating it as a magic switch.

FAQ

What does a CDN do?

A CDN stores cached copies of your website's files on servers around the world and serves each visitor from the nearest one. This shortens the distance data travels, cutting load times and Time to First Byte. Most CDNs also add security features like DDoS protection and a web application firewall at no extra cost.

Do local businesses really need a CDN?

Usually yes. Beyond geography, CDNs use faster infrastructure than budget hosts, add security like DDoS and bot protection, and improve reliability by serving cached pages even if your origin hiccups. Edge servers in major US cities still speed delivery within a region, and free or low-cost tiers suit most local sites.

Does a CDN improve Core Web Vitals?

Yes. By lowering Time to First Byte and delivering images, CSS, and JavaScript faster, a CDN helps Largest Contentful Paint and speeds when content first appears. It will not fix a page bloated with heavy JavaScript on its own, so it works best alongside image optimization and lean code.

What is the difference between a CDN and hosting?

Hosting is where your website actually lives and where dynamic pages are built. A CDN sits in front of your host, caching and serving static files from edge servers near visitors. The CDN offloads work and shortens distance, but your origin host still handles anything that cannot be cached.

Can a CDN cause problems?

Yes, mostly from misconfiguration. Caching dynamic pages can expose stale content or another user's data, while missing purge rules leaves visitors seeing outdated content after updates. A CDN also cannot fix a slow origin for uncached requests or heavy client-side JavaScript. Correct cache rules and testing prevent these issues.

Is Cloudflare a CDN?

Yes. Cloudflare is one of the most popular CDNs, widely used by small businesses because it offers a free tier, easy DNS-based setup, and bundled security like DDoS protection and a web application firewall. Other major CDNs include Fastly, Amazon CloudFront, and Akamai, each with different pricing and features.

Was this helpful?