Web Development

What Is a CDN and How Does It Speed Up Your Website? — The Complete 2026 Guide

By Asad Ali ·

A CDN is a network of edge servers that stores copies of your website's files close to your visitors, so pages load from a nearby server instead of travelling all the way to your origin every time. This guide explains how a CDN works step by step, what it caches and what it doesn't, how much faster it really makes a site, and how to set one up on a small-business website.

19 min read

Cover for What Is a CDN and How Does It Speed Up Your Website, showing a globe with network nodes, edge servers, a laptop, and a speed gauge with a lightning bolt, on a navy and teal background
What Is a CDN and How Does It Speed Up Your Website? — The Complete 2026 Guide

A content delivery network (CDN) is a geographically distributed group of servers that stores copies of your website's files close to your visitors, so pages load from a nearby server instead of travelling all the way to your origin server every time. The result is faster load times, less strain on your hosting, and a site that stays up when traffic spikes. This guide explains how a CDN works, what it caches, how much faster it really makes a site, and how to set one up on a small-business website.

Key takeaways

  • A CDN is a network of edge servers that cache your static files near your visitors; it is not a replacement for web hosting.
  • Most requests are answered by the nearest edge server (a cache hit). Only the first request for a file, or an expired one, travels back to your origin.
  • CDNs are mainstream: 54% of the 1.3 billion requests in the Web Almanac 2024 dataset were served from a CDN, and 71% of the top 1,000 sites serve their HTML through one.
  • For most small-business sites a free CDN tier is enough to start — Cloudflare's free plan costs $0 and Amazon CloudFront's always-free tier covers 1 TB of transfer a month.

Speed up your site before the CDN does its part: a CDN delivers your files faster, but it cannot shrink them. Compress your images with our free Image Compressor, convert them to the lighter WebP format with the Image to WebP Converter, and resize oversized uploads with the Image Resizer — then let the CDN carry the smaller files to your visitors.

What Is a CDN?

A CDN — short for content delivery network — is a network of servers spread across the world that work together to deliver your website's content quickly. Cloudflare, one of the largest CDN providers, defines it as "a geographically distributed group of servers that caches content close to end users" and notes that it speeds up the transfer of the assets a page needs: HTML pages, JavaScript files, stylesheets, images, and videos.

Three terms explain the whole arrangement:

  • Origin server: your web host, where the original files of your site live and where pages are generated. Every CDN still needs one.
  • Edge server: a server in the CDN's network, placed close to a group of visitors, that stores copies of your files and answers requests for them.
  • Point of presence (PoP): a location where the CDN operates edge servers — usually at or near an internet exchange point, where networks connect to each other. Cloudflare operates in 340 cities across more than 130 countries and says 95% of the world's internet users sit within 50 milliseconds of one of its locations. Amazon CloudFront runs more than 600 points of presence plus 13 regional edge caches in over 100 cities across 50 countries.

The important point is what a CDN is not. A CDN does not host your website. As Cloudflare puts it, a CDN "does not host content and can't replace the need for proper web hosting" — it caches content at the network edge, which improves performance. You still need a hosting plan; the CDN sits in front of it. If you have not chosen hosting yet, read our guide on how to choose web hosting for a small business.

How Does a CDN Work? Step by Step

When a visitor opens your site, the request does not go straight to your host. It goes to the nearest edge server first. Here is the full journey:

  1. The visitor requests a page. They type your address or click a link. Your domain's DNS points them to the CDN, not directly to your origin server.
  2. Routing picks the nearest edge. The CDN directs the request to the closest healthy point of presence — usually by anycast routing, where many locations share one IP address and internet routing steers each visitor to the nearest one, or by DNS-based routing.
  3. The edge checks its cache. The edge server looks for a fresh copy of each requested file.
  4. Cache hit: the edge answers immediately. If a fresh copy exists, the edge serves it straight away. Your origin server is never contacted, and the visitor gets the file from a server that may be a few dozen milliseconds away instead of a few hundred.
  5. Cache miss: the edge fetches from origin — once. If the file is not cached, or its copy has expired, the edge fetches it from your origin, serves it to the visitor, and stores a copy for the next person. The first visitor pays the full round-trip cost; everyone after them gets the fast path.
  6. The copy expires on a timer. Each cached file has a time to live (TTL), set by your Cache-Control headers. When the TTL runs out, the edge treats its copy as stale and revalidates it with the origin on the next request.

Diagram: how a request flows through a CDN — the edge answers from cache when it can, and only a miss reaches the origin.

VisitorbrowserEdge servernearest PoPOriginyour web hostrequestcache miss onlyCache HIT: served by the edgeOrigin is never contactedVisitor → Edge → Origin (only when needed)Files enter the cache as visitors request them

Notice what the diagram does not show: your whole site being copied to every edge server at once. A CDN fills its caches lazily — a file lands on an edge server when somebody near that server asks for it, and stays there while it keeps being requested.

What a CDN Caches — and What It Doesn't

Not everything on your site should be cached at the edge. The rule of thumb is simple: if the same file is served to everyone, cache it. If it is different per visitor, do not. The table below shows the usual split.

Content typeUsually cached?Why
Images (JPG, PNG, WebP, AVIF, SVG)YesIdentical for every visitor
CSS and JavaScript filesYesSame file, requested on every page
Fonts (WOFF2, TTF, OTF)YesStatic, long-lived, shared site-wide
Video and audio filesYesLarge files; edge delivery saves the most
PDFs and downloadsYesStatic files, often large
HTML pagesOnly with a ruleCloudflare does not cache HTML by default
Logged-in pages, carts, checkoutNoPersonal data; must never be shared
API responses with user dataNoDifferent answer per visitor
Admin pages (/wp-admin, /admin)NoPrivate; caching breaks logins

The HTML row surprises most site owners. Cloudflare's own documentation states it plainly: "The Cloudflare CDN does not cache HTML or JSON by default." Its default list covers static file extensions — images, CSS, JavaScript, fonts, video, documents — while HTML pages keep reaching your origin unless you add a Cache Rule that makes them eligible. That is a sensible default: the CDN cannot tell whether your HTML is the same for everyone or contains somebody's shopping basket, so it leaves the decision to you. The practical upshot is that a basic CDN setup speeds up your assets immediately, while full-page caching is a deliberate second step — and one you should only take for pages that are genuinely identical for every visitor.

Your Cache-Control headers are the main lever. A typical static-asset response tells the CDN (and browsers) to keep the file for a year:

HTTP/1.1 200 OK
Content-Type: image/png
Cache-Control: public, max-age=31536000, immutable

The max-age=31536000 value is the TTL in seconds — one year. The immutable directive promises the file will never change under that URL, so the edge never needs to revalidate it. The matching discipline is versioned filenames: when an image changes, give it a new name (logo-v2.png) instead of overwriting the old one, or returning visitors will keep seeing the cached copy until its TTL expires.

How Much Faster Does a CDN Make a Website?

There is no single honest percentage. Any article that promises "a CDN makes your site 50% faster" is inventing a number, because the gain depends on how far your visitors are from your origin, how much of your page is cacheable, and how heavy your pages are. What can be said, with sources, is where the gain comes from and how widely CDNs are already used.

Distance is the main cost. Every request obeys the speed of light: a visitor in Sydney loading a site hosted in Virginia waits for packets to cross the world and back, and a page with dozens of assets pays that round trip many times over. A CDN replaces most of those long trips with short ones to a nearby edge server. That is why the benefit is biggest for sites with a geographically spread audience, and smallest for a site whose visitors all live in the same city as its host.

Origin offload is the second gain. On a cache hit, your origin server does no work at all. During a traffic spike — a product launch, a viral post, a sale — the edge absorbs the load that would otherwise queue up on a small shared hosting plan and slow every visitor down. A CDN also keeps serving cached copies if your origin briefly goes down.

Modern protocols come free with the edge. CDNs were a major driver of newer HTTP versions: in the Web Almanac 2024 dataset, less than 4% of CDN requests still used HTTP/1.1, against up to 29% of non-CDN requests, and around 85% of all HTTP/3 responses observed came from a CDN.

Adoption tells its own story. In the Web Almanac 2024 dataset, 54% of more than 1.3 billion requests were served from a CDN. The 2025 edition found that 35% of HTML requests on mobile travelled through a CDN in July 2025, up from 33% in 2024 — and adoption rises steeply with a site's popularity:

Chart: share of sites serving HTML through a CDN, by popularity — hover or tap each bar for details. Source: HTTP Archive, Web Almanac 2025, mobile, July 2025 crawl.

Sites serving HTML via a CDNShare of sites in each popularity band, Web Almanac 2025Top 1,000 sites: 71%Top 1,00071%Top 10,000 sites: 70%Top 10,00070%Top 100,000 sites: 62%Top 100,00062%Top 1 million sites: 49%Top 1 million49%Top 10 million sites: 35%Top 10 million35%

The pattern is clear: the bigger the site, the more likely it sits behind a CDN — 71% of the top 1,000 sites serve their HTML through one, against 35% of the top 10 million. Small sites are catching up as free tiers and hosting bundles make CDNs a default rather than a purchase.

One honest caveat: a CDN cannot fix a slow site. If your pages are heavy because of uncompressed images, render-blocking scripts, or a slow database, the CDN will deliver those heavy pages slightly faster — it will not make them light. Pair the CDN with the basics: compress images and keep plugins lean. Our WordPress speed guide walks through the full checklist, and our responsive design guide covers the mobile side of the same problem.

CDN vs No CDN: Side by Side

FactorWithout a CDNWith a CDN
Where files come fromOne origin serverNearest edge server
Far-away visitorsSlow, long round tripsShort trips to a nearby PoP
Traffic spikesOrigin takes the full loadEdge absorbs cached requests
Origin downtimeSite is fully downCached pages may still serve
Bandwidth billOrigin pays for every byteEdge serves most bytes instead
HTTPS and HTTP/3You configure and maintain itUsually included at the edge
DDoS protectionOrigin absorbs the attackEdge network absorbs it first
Setup effortNothing extraDNS change, then mostly done
Cost$0 extraFree tier often covers small sites

The security row deserves a note. A CDN is not a security product by itself, but the big providers bundle protections small sites would otherwise never buy: Cloudflare's free plan includes unmetered DDoS protection and a managed firewall ruleset, and its network sits in front of roughly one in five sites on the internet.

Free vs Paid CDNs

Most small-business sites never need to pay for a CDN. The two best-known free options are genuinely usable in production:

  • Cloudflare (free plan, $0 a month): CDN, DNS, a free Universal SSL certificate, unmetered DDoS protection, and a managed firewall ruleset are all included. Pro costs $20 a month when billed annually ($25 month to month) and adds stronger firewall rulesets, image optimisation, and full-page WordPress caching. Business is $200 a month billed annually and adds a 100% uptime SLA. Pricing is per domain, so each site needs its own plan.
  • Amazon CloudFront (always-free tier): 1 TB of data transfer out, 10 million HTTP or HTTPS requests, and 2 million function invocations every month, with no 12-month expiry — the allowance resets monthly and never expires, per Amazon's pricing page. Usage past that is billed per gigabyte, starting near $0.085 per GB in North America and Europe.

Other providers follow the same shape: a free or pay-as-you-go tier for small traffic, then usage-based pricing. Indicative paid ranges run from around $5–$20 a month for small sites on budget providers to $200+ a month for business tiers with SLAs and support; enterprise contracts are quoted individually. Check the vendor's pricing page before you commit, because CDN pricing changes often.

When does paying make sense? When you outgrow the free tier's limits — Cloudflare's free plan has no uptime SLA and support is community forums and documentation only — or when you need features the free tier lacks, such as image optimisation or full-page caching for a dynamic site. For a brochure site, a blog, or a small shop, the free tier is the right starting point.

How to Choose a CDN

Five questions narrow the field quickly:

  1. Where are your visitors? A CDN is worth more the further your audience spreads from your origin. Check your analytics for the top countries, then confirm the provider has edge locations near them. Cloudflare and CloudFront both publish their location lists.
  2. What kind of site is it? A static site or blog caches beautifully. A WooCommerce shop or a membership site needs careful rules so carts and accounts are never cached — pick a provider whose cache rules are easy to express.
  3. How much traffic do you have? Under 1 TB a month, CloudFront's free tier covers you entirely. Under a few hundred thousand page views, Cloudflare's free plan usually covers you too. Estimate from your analytics before comparing prices.
  4. Do you want an all-in-one or a pure CDN? Cloudflare bundles DNS, SSL, and security in one dashboard, which suits owners who want one place to manage everything. CloudFront suits sites already running on AWS, where it connects directly to S3, load balancers, and Lambda@Edge.
  5. Who supports you when it breaks? Free tiers mean community support. If your site earns money every hour it is up, a paid tier with ticket or chat support is cheap insurance.

Avoid choosing on headline speed claims. No vendor publishes a like-for-like speed figure you can verify, and your own site's cache hit ratio matters far more than any provider's marketing number. The reliable test is your own measurement: set the CDN up, check your cache hit ratio, and compare Core Web Vitals before and after.

How to Set Up a CDN on a Small-Business Website

The exact clicks differ by provider, but the shape of the job is the same everywhere. Cloudflare is the simplest first CDN for most small sites, so the steps below follow its flow; the same sequence applies to CloudFront, Bunny.net, KeyCDN, and the CDN bundled into many hosting plans.

  1. Create the account and add your domain. Sign up, add your site's domain, and let the provider scan your existing DNS records. Check the scan found your mail records (MX) as well as your web records — a missing MX record silently breaks your email.
  2. Point your DNS at the CDN. On Cloudflare, you change your domain's nameservers at your registrar to the two Cloudflare nameservers you are given. DNS changes can take minutes or a few hours to propagate everywhere; our guide on what DNS propagation is explains the wait.
  3. Confirm the orange cloud (proxied) is on. In Cloudflare's DNS list, each record has a proxy toggle. Your main A/AAAA and www records should be proxied — that is what routes traffic through the edge. Mail records stay DNS-only.
  4. Set your SSL mode. Choose "Full (strict)" if your origin already has a valid certificate — most managed hosts provide one free — so the connection is encrypted end to end. "Flexible" encrypts only the visitor-to-edge leg and is a common source of redirect loops; avoid it where you can.
  5. Check the defaults, then add one cache rule for HTML if you need it. Static assets are cached by default. If your pages are the same for every visitor and you want them cached too, add a Cache Rule marking those URLs eligible for cache, with an edge TTL that matches how often the content changes. Leave logged-in areas, carts, and admin paths out of the rule.
  6. Purge the cache once, then test. After setup, purge everything once so no stale copy from testing survives. Then verify with curl — the response header tells you the truth:
curl -sI https://yoursite.com/logo.png | grep -i cache
cache-control: public, max-age=31536000
cf-cache-status: HIT

A HIT means the edge served the file. A MISS on the first request is normal — the edge just fetched it, and the second request should be a HIT. DYNAMIC means the response was never eligible for caching, which for HTML is the expected default, not an error.

WordPress shortcut: if your site runs WordPress, the official Cloudflare plugin or your host's built-in CDN integration handles most of this. Automatic Platform Optimization, Cloudflare's WordPress full-page caching add-on, costs $5 a month on the free plan and is included with Pro.

Common CDN Mistakes

  • Assuming your HTML is cached. The most common surprise: images show HIT while pages stay DYNAMIC. That is the default, and it is correct behaviour for pages that may differ per visitor. Add a cache rule deliberately, or leave HTML uncached.
  • Caching pages that must stay private. A cache rule that is too broad can serve one visitor's account page or cart to another. Never cache URLs behind a login, checkout, or anything with a Set-Cookie header.
  • Forgetting to purge after an update. You redesign the homepage, but visitors keep seeing the old one until the TTL expires. Purge the affected URLs — or the whole cache — after any visible change, and use versioned filenames for assets.
  • Setting a TTL that is too long for changing content. A year-long TTL is right for a logo that never changes and wrong for a sale banner that changes weekly. Match the TTL to how often the content really changes.
  • Running two CDNs at once by accident. Your host bundles a CDN and you add Cloudflare on top. The double layer still works, but purging becomes confusing and cache headers can conflict. Pick one layer and disable the other.
  • Judging speed from a single test. The first request to an edge is always a miss. Measure after the cache has warmed up, from a location your visitors actually live in.

When a CDN Does Not Help

A CDN is a delivery optimisation, not a cure-all. It does little for a site whose visitors are all in one city near its origin — the round trips it shortens barely exist. It does not speed up a slow database, an overloaded origin, or a page that waits on a third-party script; the edge can only deliver what the origin produces. It cannot cache a page that is different for every visitor, and on a site with almost no traffic, edge caches stay cold because files expire before anyone nearby asks for them again. If none of those apply to you, a CDN is one of the cheapest speed wins available. If one does, fix the underlying problem first and add the CDN after.

Frequently Asked Questions

What is a CDN in simple terms?

A CDN is a network of servers around the world that keeps copies of your website's files close to your visitors. Instead of every visitor downloading images, stylesheets, and scripts from your single web host, they get them from the nearest server in the CDN's network, which is faster and takes load off your hosting.

Is a CDN the same as web hosting?

No. Your web host (the origin server) stores the original files and generates your pages; the CDN sits in front of it and delivers cached copies. Cloudflare states this directly: a CDN "does not host content and can't replace the need for proper web hosting." You need both.

Do I need a CDN for a small website?

Not always, but it is often worth it because the entry cost is zero. If your visitors are spread across countries, your images are heavy, or your hosting plan struggles under traffic spikes, a free CDN tier gives you faster delivery, less origin load, and DDoS protection for nothing.

How much does a CDN cost?

Many small sites pay nothing: Cloudflare's free plan is $0 a month, and Amazon CloudFront's always-free tier covers 1 TB of transfer and 10 million requests a month. Paid plans start around $20 a month for Cloudflare Pro and scale with traffic and features; enterprise plans are quoted individually. Check the vendor's pricing page before committing.

Will a CDN slow down my website?

It should not, once the cache is warm. The first request for a file is a cache miss and takes the normal round trip to your origin. After that, cached files come from the nearby edge and load faster. If your site got slower after adding a CDN, check for a misconfigured SSL mode, a double-CDN setup, or an uncached dynamic page doing extra work.

Does a CDN help SEO?

Indirectly, yes. Google uses page experience signals, including Core Web Vitals, as ranking factors, and a CDN improves the network part of those metrics by cutting round-trip time and origin load. A CDN alone will not rank a thin or irrelevant page — content quality still decides.

Sources: Cloudflare, "What is a CDN?", cloudflare.com/learning/cdn/what-is-a-cdn/; Cloudflare, "Default Cache Behavior", developers.cloudflare.com/cache/concepts/default-cache-behavior/; Cloudflare, "Get started with Cache", developers.cloudflare.com/cache/get-started/; Cloudflare, "Pricing", cloudflare.com/plans/; Cloudflare, "Global Network", cloudflare.com/network/; Amazon Web Services, "Amazon CloudFront Documentation", aws.amazon.com/documentation-overview/cloudfront/; Amazon Web Services, "Amazon CloudFront Pricing", aws.amazon.com/cloudfront/pricing/pay-as-you-go/; HTTP Archive, "Web Almanac 2024 — HTTP", almanac.httparchive.org/en/2024/http; HTTP Archive, "Web Almanac 2025 — CDN", almanac.httparchive.org/en/2025/cdn. All sources checked 30 November 2026.

Want your website to load faster for visitors everywhere? A CDN is one part of the job — image sizes, hosting, caching rules, and Core Web Vitals all matter too. Asad Webs builds fast, search-ready websites for small businesses in the USA, UK, and Europe, and we can audit your site's speed and set up the right caching for it. Tell us about your project and we will come back with a clear plan and an honest quote.

Category: Web Development

Tags: web-development · website-speed · cdn

About Asad Ali

Asad Ali is a graphics designer with over 20 years of experience — designing since 2003 — and the founder of Asad Webs, based in Pakistan. He builds the free online tools on this site and writes the guides published here.

LinkedIn Facebook Website
KEEP READING

Next guide

Caddy: Free HTTPS, Automatically — The Go Web Server That Does the Boring Parts for You →

Related articles

Join the conversation

No account needed. Comments appear only after approval. Your email address will not be published.

Be the first to share a useful question or thought.

You won’t be subscribed to any mailing list.
WELCOME BACK

Sign in

Access your orders, saved products and account.