Skip to main content

What Is a CDN and Does a Small Business Website Actually Need One?

In this article

A content delivery network, or CDN, is a set of servers spread around the world that keep copies of your website's files. They hand them to visitors from whichever server is nearest. Your site still lives on one server, the origin. The CDN sits in front of it, answers most requests for images, stylesheets and scripts itself, and passes the rest through.

Does a small business need one? If your customers are in the UK and your server is in the UK, the speed gain is small, because the distance it removes was never large. A CDN is still worth having at the free tier most providers offer. The TLS handling, the caching and the protection from traffic spikes and attacks come with it. If you sell or serve people abroad, or your pages carry a lot of images, the answer is a plain yes.

The rest of this post explains what a CDN actually does to a request and what it cannot do. It also covers how to decide for your own site, and the setup mistakes that catch Django sites in particular.

What a CDN does to a request

When someone types your address, their browser looks up the domain and gets back the address of the CDN rather than your server. The request goes to the CDN's nearest location, which providers call an edge or a point of presence. The edge checks its cache. If it holds a fresh copy of the file, it sends it, and your server never hears about the request. If not, it fetches the file from your origin, keeps a copy and sends it on, and the next visitor in that part of the world gets the cached one.

The reason this matters is distance. Light in glass fibre travels at roughly two hundred thousand kilometres a second. So a signal from the UK to Australia and back cannot take less than about 170 milliseconds, and real cable routes make it longer. Loading a page needs several such round trips before the first byte of HTML arrives: the DNS lookup, the connection, the TLS handshake, then the request itself. A visitor in Sydney fetching from a server in Bristol can wait the best part of a second before anything appears, and then every image repeats part of the journey. An edge in Sydney answers in a few milliseconds.

Modern CDNs do more than cache. They terminate TLS at the edge, so the slow handshake happens close to the visitor even when the HTML still comes from your server. They compress text, speak HTTP/2 and HTTP/3, and absorb traffic that would overwhelm a single server, whether that is a television mention or an attack. Most will also resize and convert images on the fly, and filter obvious bot traffic before it reaches you.

What a CDN does not do

  • It does not speed up your HTML unless it is allowed to cache it, and for pages with logins, baskets or personalised content it usually is not. A slow server is still slow behind a CDN; our post on server response time and TTFB covers that side.
  • It does not shrink oversized images unless you pay for its image service. A 5 MB photo is a 5 MB download from the edge too.
  • It is not hosting and not a backup. Your origin still has to exist, be maintained and be backed up.
  • It does not fix a slow database, a heavy JavaScript bundle or a page that jumps about while loading.

The layers of caching that a CDN is one part of, and what belongs in each, are covered in our post on browser, server and CDN caching.

When a small business gains little from one

  • Your customers are in the UK and so is your server. The round trip across the country is a few milliseconds; a CDN cannot remove much.
  • The site is a handful of pages with modest images and already loads quickly.
  • Your traffic is steady and well within what the server handles.
  • Your main speed problem is the server's first byte or an oversized hero image, which a CDN leaves untouched.

The Golf Cabin is a good example: an indoor golf simulator venue near Bristol. Its visitors are local and its bookings happen on Trackman's own system, so an edge cache has little to work with. What makes that site fast is the code and the hosting, not a CDN.

When it is worth having

  • You sell or serve people abroad. Stamp and Bake ships cookie cutters from Bristol to the UK, Europe, the USA, Canada and Australia, and every product page carries photos of the 3D-printed cutters. With a CDN, a shopper in Toronto would get those photos from an edge near Toronto rather than across the Atlantic.
  • Your pages are image-heavy: portfolios, galleries, product grids with dozens of photos.
  • Your traffic arrives in bursts, from press coverage, a mailing or a seasonal rush, and you would rather the edge absorbed it.
  • You want a web application firewall and bot filtering in front of the site without running them yourself.
  • You want HTTP/3 and modern TLS without touching the server configuration.

On the online shops we build, a CDN in front of the product images is worth adding once orders start coming from outside the UK in numbers. The images are the bulk of every page and they are the same for every shopper. The HTML, with its prices in the shopper's own currency and its basket, still comes from the origin.

Choosing one and setting it up

OptionTypical fitCost modelWatch for
Cloudflare free planMost small business sitesFree; paid plans add image and security featuresIt proxies the whole domain, so check how HTML is handled
Bunny or a similar pay-as-you-go CDNImage-heavy sites, mediaPer gigabyte transferredUsually a separate hostname for static files
Amazon CloudFront, FastlyLarger platforms with their own engineersPer request and per gigabyte, with many more settingsMore to configure; easy to overspend
No CDNUK-only, small, already fastNothingRevisit if you start selling abroad
  1. Choose a provider and add your domain. For a Cloudflare-style setup your nameservers move to the provider; for a static-file CDN you point a subdomain such as static.yourdomain.co.uk at it and serve images from there.
  2. Keep HTTPS end to end. The CDN presents a certificate to visitors, and it should connect to your origin over HTTPS too, in the mode that verifies the origin's certificate. Our post on SSL certificates and HTTPS covers the origin side.
  3. Set the cache rules. Images, CSS, scripts and fonts: cache for a long time. HTML: bypass, or cache for a few minutes only when no session cookie is present. Admin, account and checkout paths: never cache.
  4. Send the right headers from the origin. The CDN obeys Cache-Control, so a Django site with hashed static files and sensible headers works with the defaults.
  5. Restrict the origin. Once the CDN is in front, allow web traffic to your server only from the CDN's addresses, so nobody can bypass the filtering by finding the origin's IP.
  6. Test from abroad. WebPageTest can run a test from Sydney or Virginia; compare the first byte and the image load times before and after.

Two Django-specific traps. A cache-everything rule applied to the whole domain will cache pages that include the CSRF token and the session, so one visitor's page is served to another. Use a cookie-based bypass. And Django needs to be told it is behind a proxy, so that it reads the visitor's real address and whether the connection was secure from the forwarded headers. The SECURE_PROXY_SSL_HEADER setting handles the second and a short middleware the first.

Questions people ask

Is Cloudflare a CDN?

Yes. Cloudflare is the CDN most small businesses meet first, because its free plan covers caching, TLS, HTTP/3 and basic attack protection, and it is set up by moving your nameservers. It also sells DNS, security and hosting products, which is why the name gets used more broadly.

Does a CDN improve SEO?

Indirectly. Google ranks on Core Web Vitals measured from real visitors. A CDN shortens the download of the images and files that feed Largest Contentful Paint, especially for visitors far from your server. For a UK site with UK visitors the effect is small; the server and the images matter more.

Does a CDN replace hosting?

No. The CDN caches copies; your site still needs a server to generate pages, run the database and hold the originals. Our guide to hosting for small businesses and startups covers that choice. Some CDNs will host a purely static site, but a Django site with forms, accounts or a shop is not static.

How much does a CDN cost?

Entry-level plans from the main providers are free. Paid plans are usually priced per gigabyte transferred or per feature, so a brochure site costs very little and a site serving video costs more. Image optimisation and firewall rules are the features small businesses most often end up paying for.

Where to start

Look at where your orders or enquiries came from over the last year. If they are all in the UK, put the free tier of a CDN in front of the site for the TLS and the spike protection, and leave HTML uncached. Spend your effort on the server and the images instead. If a meaningful share is abroad, or your pages are built from photographs, set the CDN up properly for static files and test from the countries your customers are in.

The edge also filters the bulk of hostile traffic before it reaches the server, which sits well alongside the items in our website security checklist. If the site ever outgrows one server, the CDN is already where a load balancer would go.