CDN for WordPress

Published: May 27, 2026 · Author: Marcin Szewczyk-Wilgan

CDN (Content Delivery Network) is a network of edge servers distributed across many locations worldwide, designed to serve content from the point closest to the user. For WordPress, this means lower load times, reduced origin server load, and better Core Web Vitals scores. Sounds simple, but the devil is in the details – WordPress generates content dynamically, and a CDN by nature works best with static content.

How a CDN Works in the Context of WordPress

Without a CDN, every request goes to the origin server regardless of where the user is connecting from. If the server is located in Germany and the user is browsing the site from Australia, network latency alone adds 200 to 400 ms to the response time. A CDN eliminates this distance by serving content from the nearest PoP (Point of Presence).

In the simplest configuration, a CDN handles only static assets: CSS, JavaScript, images, and fonts. The origin server still generates HTML via PHP and the database. This is a safe, easy-to-implement solution that offloads the server from serving files and speeds up their delivery.

A more advanced configuration is edge caching, where full HTML pages are cached on edge servers. An anonymous user's request hits the CDN, the CDN returns the cached copy of the page, and the request never reaches the origin server. This delivers the lowest possible TTFB but requires a well-thought-out cache invalidation strategy and proper handling of dynamic pages.

When a CDN Actually Speeds Up Your Site

A CDN is not a universal speed booster. Its effectiveness depends on the traffic profile of your site and the geographical distribution of visitors.

High impact

Geographically dispersed traffic

A blog with readers from Poland, Germany, the US, and Asia. A WooCommerce store serving customers from multiple countries. A portal with content in several languages. Here, a CDN with edge cache reduces TTFB for distant users from hundreds of milliseconds to a few dozen. The difference is noticeable to the naked eye.

Moderate impact

Domestic traffic, local server

A business website with traffic mainly from one country, hosted on a server in the same country or region. A CDN for static assets (images, CSS, JS) still helps because it offloads the origin server. Edge caching HTML makes less of a difference since network latency is already low. Worth it, but not a game-changer.

Minimal impact

Local traffic, few static assets

A simple business card site with a few pages and minimal graphics, visited mostly from one region. Here, a well-configured page cache on the origin server will deliver better results than a CDN. Adding a CDN to such a site is optimization with nothing to optimize.

Important

A CDN does not replace hosting

A CDN caches and distributes content but does not generate it. A slow origin server means slow responses on cache misses, a slow admin panel, and a slow WooCommerce checkout. A CDN masks performance issues for anonymous traffic but does not fix them. Good hosting is the foundation; a CDN is a layer on top of that foundation.

Cloudflare and WordPress

Cloudflare is by far the most popular CDN among WordPress users, primarily thanks to its generous free plan and ease of configuration. The free plan includes a CDN for static assets, DDoS protection, a free SSL certificate, and DNS. This is a solid baseline that is sufficient for many sites.

The real game-changer for WordPress is Cloudflare APO (Automatic Platform Optimization) at $5 per month (included in Pro plans and above). APO caches full HTML pages on edge servers, meaning an anonymous user gets the complete page from the nearest PoP without engaging the origin server. The Cloudflare plugin for WordPress manages cache invalidation when new content is published, pages are edited, or menus are changed.

It is worth being aware of a few Cloudflare pitfalls when used with WordPress. Email Address Obfuscation can break forms and mailto links. Rocket Loader may conflict with JavaScript optimization plugins. Auto Minify can cause issues with some themes. Each of these features can be disabled, but you need to know they exist and test your site after enabling Cloudflare.

CDN and WooCommerce

WooCommerce stores are a scenario where a CDN is simultaneously most valuable and hardest to configure correctly. Catalog and product pages benefit from edge caching because they are identical for every anonymous user. The problem begins where content is dynamic: the cart, checkout, customer account, and pages with location-dependent pricing.

Cloudflare APO automatically bypasses the cache for logged-in users and pages with WooCommerce session cookies. With manual edge cache configuration (e.g., Page Rules in Cloudflare), you must manually exclude paths such as /cart/, /checkout/, /my-account/ and any pages requiring a session. An error in this configuration means serving one cart to all users, which leads to complaints and lost orders.

It is also worth remembering that a CDN with edge caching changes the invalidation dynamics. A new product, a price change, or a stock level update must effectively clear the cache not only on the origin server but on all CDN edge servers. With a well-configured plugin (LiteSpeed Cache, WP Rocket with Cloudflare integration), this happens automatically. With manual configuration, it is an additional point that requires attention.

CDN, Reverse Proxy, and Page Cache

A CDN, reverse proxy, and page cache are three layers that complement each other rather than compete. Page cache generates a static HTML file on the origin server, eliminating PHP. A reverse proxy (e.g., Nginx FastCGI cache) serves that file without engaging the backend. A CDN distributes it to edge servers closer to the user.

The optimal configuration combines all three: page cache or server-level cache on the origin to minimize response generation time on cache misses, plus a CDN on the front to minimize latency. Cloudflare on the free plan simultaneously acts as both a CDN and a reverse proxy (SSL termination, DDoS protection, basic caching), making it the simplest way to get both layers at once for many WordPress sites.

CDN Impact on Core Web Vitals

A CDN primarily affects two metrics: TTFB and LCP. TTFB (Time to First Byte) drops because the response comes from a closer server. LCP (Largest Contentful Paint) improves when the CDN serves optimized images (conversion to WebP/AVIF, resizing) and caches full HTML pages, because the browser receives all resources needed to render the largest element more quickly.

CDN has minimal impact on CLS (Cumulative Layout Shift) and INP (Interaction to Next Paint). These metrics depend on the front-end: correct CSS, the absence of dynamically injected elements, and JavaScript optimization. If a site has CLS or INP problems, a CDN will not solve them. Core Web Vitals optimization requires work on multiple levels, and a CDN is just one of them.

Frequently Asked Questions

Not every one. A CDN shortens the physical distance between the server and the user, so the biggest gains come with geographically dispersed traffic. A business website with local traffic, hosted on a server in the same country, will see little benefit. A static CDN for CSS, JS, and images is always beneficial, but edge caching HTML only makes sense when traffic comes from many locations.

Partially. APO caches full HTML pages on Cloudflare edge servers, eliminating the need for page cache on the origin server for anonymous traffic. You still benefit from a cache plugin for CSS/JS minification, image optimization, and object cache (Redis). For logged-in users and dynamic pages (cart, checkout), APO automatically bypasses the cache.

Yes, primarily it impacts TTFB and LCP. A page served from an edge server has a lower TTFB than the same page fetched from an origin server on the other side of the world. A CDN with image optimization (conversion to WebP/AVIF) also improves LCP. CDN has minimal impact on CLS and INP, as those metrics depend on the front-end and browser-side optimization.

No. A CDN caches and distributes content but does not generate it. A slow origin server means slow responses on cache misses, a slow admin panel, and a slow WooCommerce checkout. A CDN masks performance issues for anonymous traffic but does not fix them. Good hosting is the foundation; a CDN is an optimization layer on top of that foundation.

Cloudflare offers a free plan with a CDN for static assets and basic security. Cloudflare APO (edge cache for full WordPress pages) costs $5 per month on the free plan and is included in paid plans (from $20/month). Alternatives such as bunny.net or KeyCDN charge by data transfer. For most WordPress sites, free Cloudflare with APO at $5 is the best value for money.

Let’s Talk About Your WordPress Site’s Performance

We will analyze your hosting and CDN configuration, identify bottlenecks, and propose concrete actions. No commitments, no marketing jargon.

Phone

+48 608 271 665

Mon–Fri, 8:00–21:00 CET

E-mail

kontakt@weboptimo.pl

We respond within 24h

Company

WebOptimo

VAT ID: PL6391758393