A CDN (Content Delivery Network) is a network of servers that keeps copies of your site's files, such as images, CSS and JavaScript, on servers in different parts of the world and serves each visitor from the nearest point. The short answer to "what is a CDN?" is this: it is an intermediate layer that shortens the distance data has to travel to reach the visitor. In this article, we explain how it works, when it really helps and what to watch out for when setting it up.
In short
- A CDN serves your site's files from "edge" servers close to the visitor; it does not replace your main server (the origin).
- Its biggest benefits are reducing latency caused by distance and taking load off the origin server.
- By default, most CDNs cache static files such as images, CSS and JS; HTML pages need extra configuration.
- The benefit is clear if your visitors are spread across different cities and countries or if you use heavy images.
- Wrong cache settings can lead to stale content and problems with forms and carts.
What is a CDN?
In MDN's definition, a CDN is a group of servers spread out over many locations. These servers store copies of data so that requests can be served from the server nearest to the user.
Knowing two terms makes things easier:
- Origin server: The server your site actually runs on, i.e. your hosting account or virtual server.
- Edge server: Servers in the CDN provider's data centers in different cities that hold copies of your files.
A CDN is not an alternative to hosting. Your site still runs on a server; the CDN is a layer placed in front of it that replicates and distributes your files. We covered the types of hosting in our article What is web hosting?
How does a CDN work?
Let's walk through the flow step by step:
- A visitor goes to your site. Your domain's DNS record is set up to route the request to the CDN (we explained how DNS works in our article What is DNS?).
- The request goes to the edge server closest to the visitor.
- If the edge server has an up-to-date copy of the file, it is sent directly from there. This is called a "cache hit."
- If there is no copy, or the copy has expired, the edge server fetches the file from the origin server, sends it to the visitor and stores it for the next request.
As a result, a visitor in Istanbul and a visitor in Berlin get the same image from different servers, each close to them.

Why does a CDN make a site faster?
As we explained in What is latency?, the physical distance data travels adds time to every request. Because a web page is made up of dozens of files, that time adds up noticeably. A CDN reduces the burden by shortening the distance.
Google's web.dev guide points to the same thing: users far from the origin server can experience a high Time to First Byte (TTFB). For sites that don't use a CDN, moving to one is recommended as one of the first steps for improving TTFB.
Besides speed, there are other benefits:
- Less load on the origin server. Because requests for images and files are served by edge servers, your server handles less traffic and fewer requests.
- More resilience during traffic spikes. As MDN's definition also notes, a CDN provides a service that is less affected by heavy traffic. Sudden surges in visitors after a campaign or a news story put less pressure on the origin server.
- An extra layer of security. Many CDN providers offer services such as attack traffic filtering and a web application firewall in the same layer. The scope of these features varies by provider and plan.
What content does a CDN cache?
A common assumption needs correcting here: the moment you switch to a CDN, your whole site is not served from the edge.
For example, Cloudflare's documentation states clearly that the CDN does not cache HTML or JSON by default. What gets cached by default is determined by file extension: images (JPG, PNG, WEBP, AVIF, SVG…), CSS and JS files, fonts, and files such as PDFs and videos.
In practice, this means:
- Static files (images, CSS, JS, fonts) come quickly from the CDN.
- The HTML page itself is still generated by your origin server. If your server is slow, the page's first byte will still arrive late.
- You can cache HTML at the edge as well, but that is a deliberate setting. Personalized pages, such as those for logged-in users, the cart, checkout and form pages, must be kept out of the cache.
web.dev also points this out: requests that go to the origin for personalized content can wipe out much of the benefit you'd expect from a CDN.
| Content type | Default CDN behavior (general) | Note |
|---|---|---|
| Images, CSS, JS, fonts | Cached | The easiest win |
| PDFs, videos, downloadable files | Mostly cached | Bandwidth savings for large files |
| HTML pages | Not cached by default with most providers | Needs separate rules and a cache purge routine |
| Cart, checkout, member area, forms | Should not be cached | Personalized content |
Does your site need a CDN?
Not every site needs a CDN. When deciding, consider these questions:
- Where are your visitors? If nearly all of them are in a single city or country and your server is in the same region, a CDN's speed impact may be limited. If your visitors are spread across different countries (exporters, bilingual sites), the impact is clear.
- How image-heavy is your site? Product catalogs, portfolios and project galleries carry many large images. Serving these files from the edge helps both speed and server load.
- Is your traffic uneven? If you see sudden surges during campaigns, protecting the origin server becomes important.
- Is your server already slow? A CDN speeds up static files, but on its own it doesn't fix slowly generated HTML. You may need to fix the server and page caching first.
Common mistakes when setting up a CDN
- Forgetting to purge the cache. You changed an image or a CSS file on the site, but visitors still see the old one. The copy on the CDN needs to be purged too.
- Caching personalized pages. Caching a cart or member page can cause serious problems, such as one user seeing content that belongs to someone else.
- Changing DNS without a plan. Some CDNs require you to change your domain's nameservers. Make sure your email (MX) and other DNS records are moved over completely.
- Deciding without measuring. Measure speed before and after adding a CDN. That's the only way to see the benefit.
- Treating a CDN as a cure for a slow server. A slow back end can stay slow despite a CDN.
CDNs on WordPress sites
On WordPress sites, a CDN is usually managed together with a caching plugin. For example, the LiteSpeed Cache plugin's documentation describes three routes: setting up QUIC.cloud, LiteSpeed's own CDN service; managing your Cloudflare account from within the plugin (e.g. also purging the Cloudflare cache when you do a full purge in the plugin); and mapping file URLs for other CDNs that work as a reverse proxy. Which route is right depends on your server, where your domain's DNS is managed and how your site is built.
Our experience
Our own site runs on a LiteSpeed server with the LiteSpeed Cache plugin. In our speed work, we sorted out the origin side first: we combined CSS files, served fonts locally and prepared small font subsets for Turkish characters. Our takeaway from this experience is that layers such as a CDN or caching only work when they are built on a solid foundation. We also choose cache settings based on the visitor experience. For example, we keep the "Guest Optimization" option turned off because it can delay JavaScript until the first interaction and break menus and forms.
In client projects, we decide on a CDN by looking at where the audience is, how image-heavy the site is and what the server infrastructure looks like.
Frequently asked questions
Does a CDN replace hosting?
No. A CDN is a layer that distributes copies of your site's files. Your site still runs on a hosting account or server. The CDN sits in front of that origin server.
All my visitors are in Turkey. Should I still use a CDN?
If your server is also in Turkey and your site isn't very image-heavy, the speed gain may be limited. It may still be worth considering to reduce server load and to be more resilient to traffic spikes. The best approach is to measure before and after and then decide.
Why don't my changes show up on the site after switching to a CDN?
Most likely the edge servers are serving an old copy of the file. You need to purge that file, or the whole cache, from the CDN dashboard or your caching plugin.
Does a CDN affect SEO?
A CDN is not a direct ranking factor. However, by improving page speed and user experience, it can have a positive effect on Core Web Vitals metrics. We explained these metrics in our article What are Core Web Vitals?
Conclusion
A CDN reduces latency caused by distance and takes load off the origin server by serving your site's files from points close to your visitors. It makes the most difference on image-heavy sites with widely spread visitors. But without the right cache rules, a purge routine and a solid server infrastructure, it won't deliver the benefit you expect.
If you'd like to review your site's infrastructure and speed together, take a look at our web design and WordPress development services, or write to us.
Sources6
- MDN Web Docs, "CDN" developer.mozilla.org
- web.dev, "Optimize Time to First Byte" web.dev
- Cloudflare Docs, "Cache" developers.cloudflare.com
- Cloudflare Docs, "Default cache behavior" developers.cloudflare.com
- LiteSpeed Documentation, "LSCache for WordPress — CDN" docs.litespeedtech.com
- Ilya Grigorik, *High Performance Browser Networking*, "Primer on Latency and Bandwidth" hpbn.co



