What Is a CDN: CDN Meaning, Why Use It, and How to Connect WordPress

Test environment RHEL familyAlmaLinux 9.8Checked 2026-10-16

A CDN (Content Delivery Network) is a network that stores copies of the origin server's files on edge servers in many regions and responds to each visitor from the server closest to them. To see whether edge servers respond from cache, we checked the response headers of a public library delivery service such as jsDelivr, and the jQuery file was being served from a cached copy. We compared the two ways of connecting WordPress, rewriting file URLs and using a DNS proxy, based on official documentation.

1️⃣ CDN meaning: edge servers and the origin server

A POP (Point of Presence) is a data center that houses edge servers, and each visitor's request is routed to the nearest POP.

When an edge server receives a request, it responds right away if it has the file stored; if not, it fetches the file from the origin server, responds, and stores it on the edge server. CloudFront, the CDN from AWS, starts delivering to the visitor as soon as the first byte arrives from the origin server (per AWS official documentation).

CDN edge servers and the origin server

Edge servers store only the files that visitors have requested, so even for the same file, the first request at each edge server goes all the way to the origin server.

Fetching files when a request comes in like this is called the pull method, and there is also a push method, where you upload files to the CDN in advance.

2️⃣ Why use a CDN: distance and origin server load

The farther apart the visitor and the server are, the longer the round-trip time (RTT) of each request. Opening a single page triggers requests for images, CSS, and JavaScript on top of the HTML, so when a nearby edge server responds, the round trip gets shorter for every request.

Requests answered by an edge server never reach the origin server, which also lowers the origin server's CPU usage and data transfer (bandwidth). When you connect DNS through the Cloudflare proxy, the origin server's IP is not exposed, and DDoS attacks are blocked at the CDN first (per Cloudflare official documentation).

For a site whose visitors are concentrated in the same region as the origin server, the benefit from distance is small. For such sites, the bigger benefits of a CDN are lower origin server load and less data transfer rather than faster response times.

3️⃣ Files that get cached: static files and HTML

By default, Cloudflare caches only static files such as images, CSS, and JavaScript, identified by file extension (per Cloudflare official documentation). Page HTML and JSON are excluded from default caching, so the origin server still responds to them even after you connect Cloudflare.

To cache HTML as well, you need to create a separate cache rule on the CDN. In that case, exclude pages whose content differs from person to person, such as those for logged-in users or shopping carts, from the rule so that visitors never see someone else's screen.

4️⃣ Connecting WordPress: file URL rewriting and DNS proxy

To connect a CDN to WordPress, you either change only the static file URLs to CDN URLs, or set your domain's DNS to the CDN proxy so that every request goes through the CDN.

methodWhere you connect itRequests through the CDNOrigin server IP
File URL rewriteEnter the CDN address (CNAME) in the cache plugin's CDN settingsStatic files such as images, CSS, and JavaScriptStays public
DNS proxyPoint the domain's DNS records to the CDN proxyAll HTTP and HTTPS requests to the siteHidden behind the CDN

With the file URL rewrite method, cache plugins such as WP Rocket let you enter the address (CNAME) provided by your CDN provider in their CDN settings. Once entered, the image, CSS, and JavaScript URLs in the page HTML are changed to CDN URLs (per WP Rocket official documentation). The HTML itself is still served by the origin server.

WP Rocket settings screen: Other CDN in the Content Delivery tab, the Your CDN switch, and the CDN CNAME(s) row
In the [Content Delivery] tab of [Settings › WP Rocket], opening [Other CDN] shows the [CDN CNAME(s)] row where you enter the CDN address. Enter the CDN address and turn on the [Your CDN] switch above it to change file URLs to the CDN address; if you have several addresses, add rows with [+ Add CNAME].

With the DNS proxy method, your domain's DNS is managed by the CDN provider. Cloudflare also offers a way to connect the proxy without moving your nameservers, by adding only CNAME records at your existing DNS provider. This method is available only on Business plans and above (per Cloudflare official documentation).

5️⃣ Checking cache hits: the cf-cache-status and age headers

You can tell whether a CDN served a file from cache by its response headers. Below are the command we used to check the response headers of the jQuery file distributed by jsDelivr and its output.

curl -sI https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js | grep -iE "^(cache-control|cf-cache-status|age|server):"
cache-control: public, max-age=31536000, s-maxage=31536000, immutable
age: 45920
cf-cache-status: HIT
server: cloudflare

[server: cloudflare] shows that a Cloudflare edge server sent this response, and [cf-cache-status: HIT], added by Cloudflare, means it was served from cache. [age: 45920] shows that this file has been in the cache for about 12 hours and 45 minutes. [max-age=31536000] is the origin server's instruction that the file may be stored for one year.

To see how far a request goes when the value is [MISS], [DYNAMIC], or [BYPASS] instead of [HIT], press the value buttons in the diagram below.

🧩 cf-cache-status Where the request goes for each value
Explainer diagram
📨 cf-cache-status
🧑‍💻 Visitor
Response header receivedcf-cache-status: HITcf-cache-status: MISScf-cache-status: DYNAMICcf-cache-status: BYPASS
Served straight from cacheServed with the fetched fileOrigin response passed throughOrigin response passed through→
🌐 Nearest edge server (POP)
💾 CacheStored file foundNo stored file, fetched file storedNot cacheable (HTML), no checkCacheable but not stored
Server close to the visitor
Does not reach the origin serverFetches the filePassed on without a cache checkFetches the file→
🖥️ Origin server
No requestsResponds with the fileHTML responseResponse header Cache-Control: no-store or private
[cf-cache-status: HIT] means the edge server responded straight from cache, and this request does not reach the origin server.
A file fetched from the origin server because it was not in the cache is marked [MISS], and the edge server stores that file as it responds.
HTML that is not cacheable, and so is passed to the origin server without a cache check, is marked [DYNAMIC].
If the origin server's response includes a [Cache-Control: no-store] or [private] directive, even a cacheable file is marked [BYPASS] and is not stored.

🔢 FAQ & Recommended Content

Web hosting is the server that holds your site's original files and database, while a CDN is a network in front of it that responds with copies of those files. Even with a CDN connected, you still need the origin server.

Varnish stores responses in one place in front of the origin server, while a CDN does the same job on edge servers in many places around the world. The response headers of the official jQuery CDN (code.jquery.com) include [via: 1.1 varnish, 1.1 varnish]. This header confirms that the code.jquery.com edge server responded through Varnish.

Use the cache purge function in the CDN dashboard to delete specific URLs or the entire cache. Some WordPress cache plugins also clear the connected CDN's cache when you edit a post.

ℹ️ Affiliate Disclosure
This site's content contains affiliate links. When a visitor buys a product or service through one of them, the site receives a commission from the seller. The amount the buyer pays(it goes down during event discounts ↓)does not go up. Posted prices, discounts, and stock reflect the time of writing and may differ, so confirm with the seller before buying. Products are chosen and reviewed by our own standards, and commissions do not affect the order or content of reviews.