A content delivery network (CDN) places content closer to visitors through distributed edge locations. For WordPress, that often means serving images, CSS, JavaScript, and fonts from edge caches. Some services can also proxy and cache HTML, but the behavior depends on the provider and configuration.
A CDN is not a replacement for the origin server. WordPress, its database, and uncached requests still need a secure, reliable origin.
Origin and edge requests
The origin is the server holding the authoritative site. On a cache miss, an edge requests content from the origin, stores it according to policy, and may serve later requests without returning to the origin.
Cache hits can reduce latency and origin load. Cache misses, bypasses, revalidation, and personalized pages still reach the origin.
Two common connection models
Asset URL or pull-zone model
Static asset URLs are rewritten to a CDN hostname. HTML may still come directly from the origin.
Reverse-proxy or DNS model
Traffic passes through the CDN or proxy hostname, which may cache assets and, when configured, HTML. DNS, TLS, firewall, and origin settings all affect this model.
Providers use different terms and defaults; follow the documentation for the selected service.
What to cache first
Versioned images, stylesheets, scripts, fonts, and downloads are usually safer starting points because many visitors receive identical bytes. WordPress’s performance handbook describes CDN content offloading for static files.
Confirm that query strings, versioned filenames, CORS headers, font types, and image formats work through the edge.
Understand Cache-Control and expiry
Origin response headers can tell browsers and shared caches how long a response may be stored and whether it is public, private, or not cacheable. A CDN may respect, override, or supplement those headers.
Long lifetimes suit fingerprinted static files whose URL changes when content changes. Shorter or revalidated caching is safer for assets replaced at the same URL. Never assume a WordPress plugin’s “cache” setting controls every CDN and browser layer.
Treat HTML and dynamic pages cautiously
Full-page edge caching can improve response time but needs rules for logged-in users, previews, carts, checkout, accounts, password resets, form confirmations, personalized content, and administrative endpoints.
Cookies, authorization headers, request methods, query strings, geography, and device variation may affect cache keys or bypass rules. Test each critical flow while logged out and logged in.
Purge with precision
A purge removes or invalidates cached objects so the edge requests fresh content. Purge the affected URL or tag where supported instead of clearing the entire network after every edit.
Remember that browser caches, page-cache plugins, object caches, and CDNs are separate layers. A CDN purge cannot always remove a copy already stored in a visitor’s browser.
Images and media
A CDN can deliver media closer to visitors, and some services optionally transform formats or dimensions. Verify quality, responsive srcset behavior, original-file access, cache keys, and metadata expectations.
Do not enable transformations without checking whether they crop important content or produce duplicate requests. Keep origin backups; a CDN cache is not a media backup.
How to verify the CDN is serving content
- Open an asset URL in browser developer tools.
- Confirm the requested hostname and final URL.
- Inspect response headers for provider-specific cache status, age, and cache-control information.
- Test once for a miss and again for a possible hit.
- Check more than one location if geography matters.
- Confirm the origin is not publicly bypassed where protection is intended.
- Compare logged-out and logged-in HTML behavior.
A fast response alone does not prove that an edge cache served it.
Troubleshooting patterns
- Old CSS or image: inspect URL versioning and purge the exact object.
- Mixed content: ensure origin and rewritten assets use HTTPS.
- Broken fonts: review CORS and content-type headers.
- Login or cart leakage: disable caching immediately for affected dynamic paths and cookies.
- Redirect loop: align HTTPS and proxy-awareness settings between edge and origin.
- Origin still overloaded: inspect cache-hit ratio, bypasses, bots, and uncached HTML.
Deployment checklist
- Origin backup and rollback plan exist.
- DNS and TLS changes are documented.
- Static assets load with correct types and CORS.
- Admin, login, previews, accounts, forms, carts, and checkout are excluded as needed.
- Cache-control and purge behavior are tested.
- Logged-in and logged-out sessions remain separate.
- Monitoring checks both edge and origin.
- The CDN configuration owner is known.
Use the WordPress dashboard guide when locating site settings, but follow the CDN provider’s current instructions for edge rules.
Frequently asked questions
Does every WordPress site need a CDN?
No. Benefit depends on audience geography, asset size, origin performance, traffic, and operational complexity.
Will a CDN cache wp-admin?
It should generally bypass administrative and personalized areas, but defaults differ. Verify the active rules.
Does purging the CDN clear all caches?
No. Browser, plugin, server, object, and CDN caches may need separate handling.
Conclusion
A WordPress CDN works best when its role is explicit: serve suitable content from edge locations while protecting dynamic workflows and the origin. Start with static assets, test headers and cache status, and expand only with documented exclusions and rollback.
