Websites 5 min

What Is a Content Delivery Network (CDN)?

Short answer

A content delivery network (CDN) is a globally distributed network of servers that caches and delivers your website's static files, such as images, CSS, and JavaScript, from a location geographically close to each visitor. This reduces the distance data travels, cutting page load times. CDNs also absorb traffic spikes and protect against certain types of attacks.

A CDN is a network of servers distributed around the world that delivers your website's files from a location close to each visitor, reducing load times and improving availability.

The Problem CDNs Solve

When a visitor loads your website, their browser requests files from your server. If your server is in Amsterdam and your visitor is in Singapore, the request travels roughly 10,000 kilometers each way. That round trip takes time: typically 200 to 350 milliseconds just for the network latency, before the server has even started responding.

Multiply that by a dozen file requests per page load (HTML, CSS, JavaScript, images, fonts) and latency becomes a real performance problem. Slow pages frustrate users and negatively affect your rankings in Google Search, where page speed is a direct ranking signal alongside Core Web Vitals.

A CDN solves this by placing copies of your static files on servers around the world. The Singapore visitor gets files from a CDN node in Singapore instead of your Amsterdam origin server. Network latency drops from 200 ms to 5-10 ms.

How Edge Nodes Work

CDN providers operate points of presence (PoPs), also called edge nodes, in data centers around the world. When a file is requested for the first time, the edge node fetches it from your origin server and caches a copy. Subsequent requests for the same file from the same region are served directly from the edge node without contacting your origin at all.

This caching behavior is controlled by cache headers your web server or application sends with the response. A typical setup caches images and CSS files for 30 days, since these rarely change, while HTML pages might be cached for only a few minutes or not at all.

Cloudflare, one of the largest CDN providers, operates edge nodes in over 300 cities. When you route your domain through Cloudflare, requests automatically go to the nearest node. For most small and medium-sized businesses, the free Cloudflare tier provides full CDN functionality at no cost.

Benefits Beyond Speed

Availability during traffic spikes: CDN nodes absorb sudden traffic bursts. If your website is featured in a national newspaper and thousands of visitors arrive simultaneously, a CDN handles the load without overloading your origin server.

DDoS protection: CDN providers filter out malicious traffic before it reaches your server. Distributed denial-of-service attacks, which try to overwhelm a server with fake requests, are absorbed by the CDN’s global infrastructure.

Reduced bandwidth costs: Your origin server transfers fewer files when a CDN handles repeat requests. This lowers bandwidth bills on hosting plans that charge by data transfer.

Improved uptime: If your origin server has a brief outage, some CDNs can continue serving cached pages to visitors who would otherwise see an error.

When SMBs Need a CDN

You benefit from a CDN most when your site has images, has visitors from multiple countries, or experiences uneven traffic. If you are already using a hosting platform like Cloudflare Pages, Vercel, or Netlify, a CDN is built in and active by default. There is nothing to configure.

If you are on shared hosting or a VPS, adding Cloudflare by changing your domain’s nameservers is a free upgrade that takes about 20 minutes. It immediately activates CDN caching, basic DDoS protection, and HTTPS without changes to your application code.

Our tip: After enabling a CDN, verify that your cache-control headers are set correctly. Use your browser’s developer tools to check the response headers for your main pages. Look for Cache-Control: no-store or private on any page that shows user-specific data, and Cache-Control: max-age=86400 or longer on static assets like images and CSS.

Frequently asked questions

Does my small business website need a CDN?

If most of your visitors are in the same country as your server, a CDN is a nice-to-have rather than a must-have. But if your server is in the US and a significant portion of your traffic comes from Europe or Asia, a CDN makes a meaningful difference. For businesses using Cloudflare Pages or Vercel, a CDN is already included by default. For traditionally hosted websites, adding Cloudflare's free tier is one of the easiest performance improvements available.

What is the difference between a CDN and web hosting?

Web hosting is where your application code and database live and run. A CDN sits in front of your hosting and caches the output, specifically the static files, closer to your users. They serve different purposes and are typically used together. Your origin server generates the page; the CDN delivers cached files as fast as possible. Many modern hosting platforms blur this line by building CDN functionality directly into their infrastructure.

Can a CDN hurt my website?

A misconfigured CDN can cache pages that should not be cached, such as logged-in user dashboards or checkout pages with personal data. This can result in one user seeing another user's information, which is a serious security issue. Most CDNs handle this with cache-control headers: your application tells the CDN which pages to cache and for how long. Always verify that dynamic, personalized pages are excluded from CDN caching.

Want a dashboard or automation built for you?

Stuurboard BI builds custom Power BI dashboards and workflow automations. Pragmatic, fast, and without the fuss.