What is a CDN and do I need one for my website

CDN (Content Delivery Network) is a word thrown around every time someone talks about site speed. "Put Cloudflare on it, fixed!". "You need a CDN!". But what does a CDN actually do, how, and, most importantly, do you need one? Not every site, and not always.

This guide answers those three questions without marketing fog. By the end you will know whether you actually need a CDN, which option is the most practical, and how to configure it if it goes into the plan.

What a CDN is, simply #

Your site physically lives on one server, say in Frankfurt. A visitor from Split opens the page, the request travels to Frankfurt, the server responds, the data travels back. If the visitor is in Singapore: the same path, but 12,000 km in each direction. That is latency, and it has physical limits (the speed of light is not extremely fast when geography is in play).

A CDN solves this by keeping copies of your static resources (images, CSS, JS, fonts, video) on dozens or hundreds of servers around the world: "edge nodes". A visitor from Singapore fetches the images from the edge node in Singapore, not from Frankfurt. The difference in loading can be half a second to several seconds.

What a CDN doesn't do #

A CDN doesn't speed up the dynamic HTML of your site (except with ESI / edge caching, which is more advanced). If your TTFB from Frankfurt is poor, a CDN won't fix that: some parts will be better because they don't go through your origin server, but the generation of the HTML itself is still on your hosting.

Three things a CDN actually gives you #

1. Geographic proximity for static resources #

The biggest benefit. Images, fonts, JS, CSS: all of it comes from the nearest location.

2. DDoS protection and WAF #

Big CDNs (Cloudflare, BunnyCDN, KeyCDN, Fastly) have a huge network that absorbs DDoS attacks before they reach your server. Cloudflare's basic tier is free and includes DDoS protection and a basic WAF.

3. Bandwidth offload #

If you serve large files (videos, ZIP downloads, image galleries), a CDN takes a large part of the bandwidth load off your hosting. It is often cheaper to pay for a CDN than to upgrade a hosting plan just because of bandwidth.

Do you need a CDN for your site #

Probably YES, if: #

  • You have international visitors outside your regional data centre (e.g. server in the EU, visitors from the USA, Australia, Asia)
  • More than 30% of traffic comes from outside your region
  • You have an image-heavy site (gallery, e-commerce with many products, a news portal)
  • You have video content or large download files
  • You are already a target of DDoS attacks or are attacked often
  • A marketing campaign can suddenly bring you 10x the traffic

Probably NO, if: #

  • Your site has a regional audience (e.g. the domestic market, a small company, a local service)
  • Your hosting is in the EU and your visitors are in the EU: latency is already OK
  • You have a small, page-light site (a few pages, a small number of images)
  • The site has heavily personalised content (many login-only pages)
  • You already have decent hosting with WP Fastest Cache and a server in the EU

Cloudflare #

The world's biggest network. The free plan covers basic CDN functions, DDoS protection and a basic WAF, more than enough for most small sites. Paid plans (Pro $20/mo, Business $200/mo) add image optimisation, a more advanced WAF and better support. Downside: configuration goes through their DNS (you redirect the nameservers).

BunnyCDN #

EU-based, focused on a real CDN without bloat. A pay-as-you-go model: you pay only for bandwidth, around $0005-$0.01 per GB depending on the region. Fast, transparent, popular with EU developers. No free tier, but very little is spent on small sites.

KeyCDN #

Similar to BunnyCDN, of Swiss origin. Pay-as-you-go, $0.04/GB for the first 10 TB. Good documentation, popular with tech-savvy users.

Fastly #

Enterprise-grade. Great flexibility (VCL config), real-time analytics. Used by large sites (Stripe, Pinterest, Shopify). More complex to set up. Prices from $50/mo.

How to configure a CDN (at a high level) #

There are two basic integration models:

Reverse Proxy (the Cloudflare way) #

You change the DNS nameservers to the CDN, and all traffic goes through it. The CDN caches what it can and forwards the rest to the origin server.

  1. You register with a CDN provider
  2. You add your domain
  3. The CDN gives you nameservers that you set at your domain registrar
  4. You wait for DNS propagation (up to 24h, usually a couple of hours)
  5. You configure page rules and cache rules

Pull Zone / CNAME (the BunnyCDN, KeyCDN way) #

Your site stays on its own domain. You serve static resources from a subdomain that goes through the CDN.

  1. You register a pull zone with the CDN provider (e.g. cdn.yourdomain.hr)
  2. You give it the URL of your origin server
  3. In WordPress (or wherever) you switch static asset URLs to cdn.yourdomain.hr (the CDN Enabler plugin does this for WP)
  4. Images, CSS, JS automatically go through the CDN

Trade-offs and pitfalls #

Cache invalidation #

When you change an image, CSS or JS on the site, the CDN keeps serving the old version from its cache. You need a purge: either manually through the CDN dashboard, or automatically through a plugin that triggers it.

HTTPS and SSL #

The CDN needs its own SSL for your domain. Cloudflare and others usually handle this automatically with Let's Encrypt. Check that you have no "mixed content" warnings after setup.

Analytics and logs #

Visitors no longer come directly to your server, they come through the CDN. The visitor's original IP address arrives in the X-Forwarded-For header. Check that your analytics and logs read it correctly.

Geo-restrictions #

Some countries block certain CDNs. If part of your audience is in those regions, check before committing.

Cost vs benefit: a quick calculation #

For a small site (up to 50 GB bandwidth/month): Cloudflare free is usually enough. Plus free DDoS protection.

For a medium site (50-500 GB/month): BunnyCDN or KeyCDN pay-as-you-go, around 1-5 €/month.

For a large site (1+ TB/month): prices become significant (50-200 €/month), but in that range your hosting plan is also big enough that the saving covers it.

CDN and WMD hosting #

Our servers are in the EU, so the page reaches a domestic and European audience quickly and without an external CDN. If your visitors come from outside Europe, you set up Cloudflare following the guide Cloudflare in front of the web.

FAQ #

Is a CDN mandatory for SEO? #

No. Google values speed, but not a CDN specifically. If your site is fast without a CDN, you don't need one. If a CDN helps speed, Google will see that.

Can I use several CDNs at the same time? #

Technically yes (a multi-CDN setup), practically no for most sites. It adds complexity, with little benefit.

What about GDPR and a CDN? #

A CDN processes visitors' IP addresses, which is personal data. Check that the CDN has a DPA (Data Processing Agreement) and which regions it uses. Cloudflare and BunnyCDN have European DPAs.

Will a CDN break my site? #

A standard setup won't. Aggressive cache rules (e.g. caching HTML pages) can show an old version. Test gradually.

Conclusion #

A CDN is not a universal solution. For a small regional site with good hosting, you probably don't need one. For an international site, an image-heavy page or a growing site, very likely yes, and Cloudflare free is a great first step.

The biggest mistake people make is adding a CDN as the first step to fix a slow site. It is usually the 8th or 9th step (see our 10-step checklist for a slow site). First sort out caching, images, the PHP version, a plugin audit.

Need a second opinion for your specific case? Get in touch with the specifications (where your visitors are, what kind of site it is, what speeds you currently have) and we will tell you honestly whether you need a CDN or not.