
A CDN, or content delivery network, is a group of servers in many places that keep copies of your website's files. When someone visits your website, they get those files from a server near them instead of from your own server, which may be far away. Your pages load faster, and your own server has less traffic to handle.
How does a CDN work?
A CDN works by keeping copies of your files on servers close to your visitors, so each request has a shorter trip to make. Every page visit is a request from the visitor's browser to the server your website sits on, and the answer travels back. The further away that server is, the longer the trip takes. A visitor in Australia waits longer for a website on a UK server than a visitor in the UK does.
The CDN shortens that trip with caching. Caching stores a copy of a file, so it can be sent again without asking your server each time. The first time someone in a region asks for a file, the nearest CDN server fetches it from your server and keeps a copy. Later visitors in that region get that copy straight from the CDN server until it expires. Their requests don't reach your server at all.
The copies are of files that look the same for every visitor, such as your images, logos, fonts, stylesheets and scripts. Content that changes per visitor, such as a basket or a login status, can't be cached the same way. Your own server still produces it.
None of this replaces your web hosting. Your website still lives on your own server, and the CDN only holds copies of the files it serves.
What a CDN service does for your website
A CDN service sits between your visitors and your server. From there, it helps your website in four ways:
- Faster pages. Files reach visitors from a nearby server, so pages load sooner. Use it alongside the other ways to improve your site speed.
- Less strain at busy times. When a sale or a mention in the news brings a rush of visitors, the CDN can handle the extra requests for your files, so your web hosting handles fewer requests and sends out less data.
- Fewer interruptions. Because no single server carries all the traffic for your files, the risk of your website going down is lower.
- Protection against attacks. A CDN service can also protect your website against a Distributed Denial of Service (DDoS) attack, where attackers send more traffic than your server can handle to take it offline.
CDN services differ in what else they offer. Check what a plan includes before you sign up.
What are the downsides of a CDN?
One downside of a CDN is that it adds another company between your website and your visitors. If the CDN goes down or is blocked in a region, parts of your website can stop working there. That can happen even when your own server is fine. So while a CDN spreads the load, your website now also depends on the CDN.
Cached copies can also be out of date. After you change a page, some visitors may still see the old version until the copy expires or you clear the cache. If you update your website often, find out where your CDN lets you clear its cache, so you can do it straight after a change. If your WordPress website is hosted with us, you can clear the CDN cache yourself in Performance Cache.
Do you need a CDN for your website?
Not always. You'll gain most from one if your visitors come from many countries or your pages carry large images or video. The same goes if your traffic jumps at certain times of year.
If you run a small website for local customers, with modest traffic and no large images, we'd recommend starting without a CDN. Start with your hosting and your images instead. Add a CDN once your visitors spread further or your traffic grows.
How to get started with a CDN service
The simplest route is a CDN that comes with your hosting. If your WordPress website is hosted with us, Performance Cache in the one.com plugin speeds it up with Varnish caching and a CDN. Varnish keeps ready-made copies of your pages, so WordPress doesn't have to build each page again for every visit. Performance Cache may already be on if you installed WordPress with our 1-click installer. If it isn't, you can switch it on yourself in the one.com plugin in your WordPress dashboard, as our guide to Performance Cache shows.
A page is only cached after someone has visited it once. Plugins that need to run code for every visit, such as a visitor counter, don't work correctly with the feature on.
If your website isn't built on WordPress, you can use a separate CDN service with any website. If you want a free CDN to start with, Cloudflare CDN has a free plan. That usually makes it a simple way to try one on a small website. Bunny CDN charges for the bandwidth you use, the amount of data it sends to your visitors, so your bill follows your traffic. KeyCDN lets you try it free for 14 days before you pay. Whichever you pick, check which features the plan includes.
With Cloudflare, for example, you connect the CDN through your domain rather than your website. You sign up for a Cloudflare account and add your domain to it. Then, once you've checked your DNS records as described below and turned off DNSSEC at your registrar if it's on, you switch your domain's name servers to the ones Cloudflare gives you. DNSSEC is a security setting for your domain's DNS, and changing name servers with it on can make your domain unreachable. You can switch it on again through Cloudflare once your domain is active. Name servers store your domain's DNS records, the settings that send visitors to your website and email to your inbox. You change them where your domain is registered. When you add your domain, Cloudflare can scan it for your existing DNS records, but the scan isn't guaranteed to find them all. Before you switch, check that the records for your website and your email are there. If you use our email, those are our MX, SPF and DKIM records. Our support gives you the values for your DKIM records. Keep our MX record as the only MX record for your domain, and remove any other. Our guide to email on external name servers walks you through entering them at Cloudflare, so your emails aren't marked as spam or rejected. Once the switch is done, send yourself a test email to check that it arrives. Cloudflare says to allow up to 24 hours while your registrar updates the name servers. Its setup guide for a new domain has the exact steps.
Our hosting plans come with fast NVMe SSD storage and built-in performance caching. On a WordPress website, Performance Cache also serves your files through a CDN.
See hosting plansStart with your hosting
If your pages are slow even for visitors close to your server, distance isn't the cause, so we'd look at your hosting and your pages first. Use caching, optimise your images and your database, and run the recommended PHP version. When you're ready to compare, see our hosting plans and what each one includes.
Recommended reading
HostingNov 6, 2026504 Gateway Timeout: what it means and how to fix it
A 504 Gateway Timeout means a server in between got no answer from the website in time. See whose fault a 504 error is and how to fix it, WordPress included.
HostingAug 4, 2026What is website cache?
What does cache mean? And how to clear your cache? Read the importance of cache and why it's necessary to clear your cache once in a while.
HostingAug 4, 2026What is SSH?
How does SSH work & what does it do? Learn about the history of Secure Shell's predecessor Telnet and how SSH improved our internet security in this article.
