CDN: what it does and does your website really need one?

11 min read

Wayhost visual on a navy blue background with the title “CDN: what it does and does your website really need one?” and a browser window icon

What a CDN (content delivery network) is, how it works, what it really brings to a website, when it is useless and how to set one up step by step.

By Mouhamed BANKOLE, CEO at ITNET Technologies · Updated November 17, 2026 · Reading time: 10 min

Your website takes several seconds to load for visitors far from your server, or it slows down as soon as a campaign brings in traffic. Someone then tells you to "add a CDN", without always explaining what it changes or whether your site actually needs one. This guide explains what a CDN is, how it works, what it really brings, when it is useless and how to set one up step by step without breaking your site.

In short

  • A CDN (content delivery network) is a set of servers spread around the world that keep a copy of your files and serve them from the point closest to each visitor.
  • It mainly speeds up static files (images, CSS, JavaScript, videos) and takes load off your origin server during traffic peaks.
  • It adds a layer of protection against denial-of-service (DDoS) attacks and serves recent protocols such as HTTP/3 and TLS 1.3.
  • It does little for a low-traffic local site already hosted close to its audience, and it does not fix a slow server or a poorly optimized site.
  • You set it up through DNS or through an option from your host: check first what your plan already includes.

Contents

  1. What is a CDN?
  2. How does a CDN work?
  3. What content does a CDN cache?
  4. What does your website really gain with a CDN?
  5. Does your website really need a CDN?
  6. CDN, server cache or better hosting: what is the difference?
  7. How do you set up a CDN on your website?
  8. How do you check that your CDN is working?
  9. Which mistakes should you avoid with a CDN?

What is a CDN?

A CDN, short for "content delivery network", is a network of geographically distributed servers that temporarily store copies of your website to deliver them as close as possible to each visitor.

Without a CDN, every visitor downloads everything from a single server: your host's. A user in Montreal or Dakar visiting a site hosted in Paris waits for every file to cross the ocean. With a CDN, those files are already sitting on a server near them.

A CDN relies on three components:

  • the origin server: your hosting, which remains the source of truth;
  • points of presence (PoPs) or edge servers, which keep the cached copies;
  • routing, often through DNS, which sends each visitor to the most suitable point of presence.

So a CDN does not replace your hosting: it sits in front of it.

How does a CDN work?

The CDN intercepts the visitor's request, serves its cached copy if it is still valid, and otherwise fetches the file once from your server before keeping it for the next visitors.

How a request flows:

  1. the visitor types your address; DNS returns the address of the nearest point of presence;
  2. the point of presence checks whether it already has the requested file;
  3. if it does (a "cache HIT"), it serves it immediately;
  4. if it does not, or if the copy has expired (a "cache MISS"), it requests it from your origin server;
  5. it then keeps that copy for as long as your cache headers allow.

How long a copy is kept depends on the HTTP headers your site sends, especially Cache-Control. Google's guide on server response time points out that edge caching only works when resources carry suitable Cache-Control headers, and that personalized content is a poor fit.

What content does a CDN cache?

A CDN first caches files that are identical for every visitor: images, stylesheets, scripts, fonts, videos and downloadable documents.

What caches well:

  • images and videos, often the heaviest files on a page;
  • CSS and JavaScript, loaded on every page;
  • fonts;
  • PDFs and downloadable files;
  • public HTML pages that rarely change (brochure site pages, blog posts), provided you handle purging properly.

What must not be cached:

  • the cart and checkout of an online store;
  • the customer area and any page behind a login;
  • forms and personalized API responses;
  • the CMS admin pages.

Real-world data points the same way: according to the HTTP Archive Web Almanac 2025, HTML is served through a CDN on only 35% of mobile pages, because it is more often delivered straight from the origin server.

What does your website really gain with a CDN?

A CDN cuts loading time for distant visitors, absorbs traffic peaks and adds protection, but it does not speed up what your server computes itself.

The concrete gains:

The protocol gap is measurable: according to the Web Almanac 2025, 29% of HTML traffic served by CDNs uses HTTP/3, versus effectively 0% for HTML served by origin servers. The same report finds that 95.6% of CDN traffic uses TLS 1.3, compared with 77.7% for origin servers.

To put the target in perspective, Google considers that a time to first byte (TTFB) is good at 0.8 seconds or less and poor above 1.8 seconds. A CDN helps distant visitors get under that threshold; for everyone else, the quality of your hosting is what matters.

Does your website really need a CDN?

Your website needs a CDN if its audience is geographically spread out, if it serves a lot of media or if it sees traffic peaks; it barely needs one if it targets a local audience and stays lightweight.

Your situationIs a CDN useful?Why
Brochure site for a local tradesperson, regional customersLowServer already close to visitors, few heavy files
Blog or media read at home and abroadHighVisitors far from the origin
Online store with lots of product photosHighHeavy images, peaks during promotions
Site with videos or downloadsVery highHeavy bandwidth use
Application with a customer areaMediumOnly static files benefit from caching
Site targeted by attacks or bot trafficHighThe network absorbs part of the load

Cases where a CDN adds almost nothing:

  • a local, lightweight, well-hosted site: the gain is measured in milliseconds;
  • a site that is slow because of its code (heavy plugins, badly written database queries): the CDN hides some symptoms, not the cause;
  • a fully personalized site behind a login: little is shared across visitors.

Pro tip: measure before you decide. Test loading time from several countries with a speed-testing tool; if the gap between Paris and abroad is small, work on image weight and server caching first.

CDN, server cache or better hosting: what is the difference?

Server caching speeds up how pages are built, hosting determines the power and location of the origin, and a CDN moves files closer to the visitor: they are three complementary levers.

LeverWhat it speeds upWhat it does not fixWhen to tackle it
High-performance hosting (NVMe storage, fast web server)Computing dynamic pagesDistance to faraway visitorsFirst
Server cache (page, object, opcode)Already generated pages, with no recalculationGeographic distanceSecond
CDNDelivering files as close to the visitor as possibleSlow code or an overloaded databaseThird, or as soon as your audience is international
Site optimization (images, scripts)The total weight of each pageServer powerContinuously

Our web hosting guide details the criteria that affect origin speed. For an online store, our article on VPS performance for online stores shows when to move to dedicated resources.

How do you set up a CDN on your website?

The simplest method is to turn on the CDN included with your hosting; otherwise, you go through an external provider by changing your domain's DNS records.

Start by checking what your plan already includes. At Wayhost, the web hosting page lists a "free global CDN" serving static assets from points of presence close to each visitor (275 points of presence shown), page, object and opcode caching configured from the start, and DDoS mitigation included (checked on November 17, 2026).

With an external provider, the typical procedure is:

  1. create an account with the CDN provider and add your domain;
  2. choose the integration mode: switching the domain's DNS servers, or a simple CNAME record for a subdomain dedicated to files (static.yoursite.com);
  3. edit the records in your domain's DNS zone and wait for propagation;
  4. enable HTTPS at the CDN level, with a valid certificate for your domain;
  5. define caching rules: long for static files, short or excluded for HTML, no caching for logged-in pages;
  6. explicitly exclude the admin area, the cart and the customer area;
  7. set up automatic purging on every publication (CMS plugin or API);
  8. test the site in a private window, then monitor errors for a few days.

On a VPS, you stay in control of the web server: set the Cache-Control and Expires headers yourself in your nginx or Apache configuration, since those are what the CDN will follow.

How do you check that your CDN is working?

Open your browser's developer tools, go to the Network tab and look at the response headers: a header showing "HIT" proves the file came from the CDN cache.

What to check:

  • cache header: depending on the provider, cf-cache-status, x-cache or x-cdn-cache should show HIT on the second load;
  • Age header: it tells you how many seconds the copy has been cached;
  • protocol: the "Protocol" column should show h2 or h3;
  • certificate: the padlock must be valid, with no mixed content warning;
  • response time: compare TTFB before and after, from several countries.

From the command line, curl -I https://yoursite.com/image.jpg shows the same headers without opening a browser.

Which mistakes should you avoid with a CDN?

The most serious mistake is caching a personalized page, which can show one visitor's cart or customer area to another.

Other common mistakes:

  • forgetting to purge: your changes do not appear for hours;
  • caching HTML for too long: an outdated price or stock level stays visible;
  • a misconfigured certificate between the CDN and your server, causing redirect loops;
  • leaving the origin IP address public: an attacker can bypass the CDN and hit the server directly;
  • ignoring where data is processed: if your pages contain personal data, check where the provider processes it and what your contract says;
  • stacking two uncoordinated caches (CMS plugin + CDN) without a shared purge.

Pro tip: exclude from caching any path that carries a session cookie. That rule is what prevents a personalized page from leaking.

Frequently asked questions

What is a CDN in computing?

A CDN is a network of servers spread across several countries that keep a copy of a website's files. Each visitor receives those files from the server closest to them. The site loads faster and the main server carries less load.

Is a CDN useful for a small website?

Not always. For a brochure site visited mostly by customers in the same region and hosted near them, the gain is small. It becomes useful once your audience is spread out, your site has many images or it sees traffic peaks.

Does a CDN improve SEO?

Not directly: Google does not favor a site because it uses a CDN. However, a faster site offers a better experience, which counts among quality signals. The gain is mostly real for visitors far from the server.

Does a CDN replace hosting?

No. The CDN sits in front of your hosting and only copies and delivers files. Your origin server is still essential to generate pages and handle the database and forms.

Does a CDN protect against DDoS attacks?

It helps a lot, because the load of an attack is spread across the whole network instead of hitting a single server. It does not protect you, however, if your origin server's IP address stays known and directly reachable. Combine it with protection at the hosting level.

Should HTML pages be cached on a CDN?

Yes for public pages that rarely change, such as blog posts or brochure site pages, with a purge on every update. No for the cart, the customer area and any page shown after login. When in doubt, start with static files only.

How can you tell if a website uses a CDN?

Open your browser's developer tools, go to the Network tab and look at the response headers of an image. Headers such as x-cache, cf-cache-status or Age indicate a CDN cache. The curl -I command gives you the same information.

Does a CDN work with WordPress?

Yes, WordPress works very well with a CDN. A caching plugin or your host's option rewrites static file URLs and purges the cache on every publication. Simply exclude the admin area and checkout pages.

Key takeaways

  • A CDN moves your files closer to your visitors through servers spread around the world.
  • It mainly speeds up static files and takes load off your server during traffic peaks.
  • It does not fix slow hosting or a poorly optimized site: deal with those first.
  • Personalized pages must never be cached, or you risk leaking data.
  • Check whether your hosting already includes a CDN before paying for an external service.

For a site served from Europe with CDN, caching and DDoS protection included, discover Wayhost web hosting.

Article written by Mouhamed BANKOLE, CEO at ITNET Technologies.

Have a specific question?

Our step-by-step articles answer the most common questions.

Knowledge base