Solving CDN Cache Issues on WordPress: A Troubleshooting Guide

Short answer: CDN cache issues occur when your CDN serves stale or wrong content to visitors. The fix usually involves purging the cache, adjusting TTL settings, or disabling plugins that interfere with caching.

Key takeaways

  • Purging the CDN cache is the first step when seeing stale content.
  • Browser caching and CDN caching are different; check both.
  • Misconfigured TTLs can cause assets to not update.
  • Some caching plugins conflict with CDNs and need settings adjusted.
  • Dynamic content like cart pages should be excluded from CDN cache.

You’ve set up a CDN expecting a speed boost. Instead, visitors see old styles, broken layouts, or missing images. The culprit? CDN cache issues. They’re frustrating but usually fixable. Let’s walk through the most common problems and solutions.

Why Is My CDN Serving Stale Content?

The most obvious sign of a CDN cache issue is stale content. You update a page or change a CSS file, but users still see the old version. This happens because the CDN has cached a copy and hasn’t checked for updates.

The fix is usually simple: purge the CDN cache. Most CDNs offer a “Purge” or “Clear Cache” button in their dashboard. After purging, the CDN fetches fresh content from your origin server. If you’re using a caching plugin like W3 Total Cache or WP Rocket, they often have a button to purge the CDN cache too.

But purging isn’t always instant. Some CDNs take a few minutes to propagate the purge across their edge servers. Wait a bit and check again. For persistent problems, you may need to increase the “cache expiration” (TTL) so the CDN re-checks more often.

WordPress dashboard showing caching plugin settings
Check plugin settings for CDN configuration. — Photo: viarami / Pixabay

CDN Not Caching at All? Check These Settings

Sometimes the issue is the opposite: your CDN isn’t caching anything. That defeats the purpose. If your CDN isn’t delivering cached assets, start by checking your DNS settings. The CDN’s CNAME or A record must point to the CDN provider, not straight to your server.

Also verify that your WordPress site is properly configured to serve static assets (CSS, JS, images) from the CDN. Many setups use a plugin to rewrite asset URLs. If the plugin is disabled or misconfigured, assets will load from your origin server instead.

Another common culprit is SSL mismatch. If your CDN uses HTTPS but your origin server doesn’t, mixed content warnings can break the cache. Ensure your CDN’s SSL certificate covers your domain and that you’ve enabled HTTPS on the origin as well.

Plugin Conflicts: When Caching Plugins Fight Each Other

WordPress caching plugins are powerful, but they can step on each other’s toes. If you’re using both a page caching plugin (like WP Super Cache) and a CDN caching plugin, you might end up with two layers of caching that conflict. The result? Stale content or errors.

The best approach is to use one caching solution that integrates with your CDN. Many premium plugins have built-in CDN support. If you’re using multiple, review the settings to ensure they’re not duplicating effort. You might need to disable one layer, like server-level caching if your CDN handles that already.

For deeper guidance, check out our article on 5 Common WordPress Caching Mistakes and How to Fix Them. It covers conflicts you might not expect.

Excluding Dynamic Content from CDN Cache

Not everything on your site should be cached. Dynamic content like shopping cart pages, checkout, user dashboards, or admin areas should bypass the CDN to ensure users always see up-to-date information. If you’re seeing problems with logins or cart updates, the CDN might be caching session-specific pages.

Most CDNs and caching plugins let you set rules to exclude certain URLs, cookies, or query strings. For example, exclude all URLs containing “cart” or “my-account”. Also make sure the WordPress admin area (wp-admin) isn’t cached. A misstep here can cause bizarre issues like users seeing other users’ carts.

Developer debugging CDN cache issue with browser dev tools
Use browser tools to inspect cache headers. — Photo: Pexels / Pixabay

Step-by-Step: Diagnose Your CDN Cache Issue

When you’re stuck, follow these steps to isolate the problem. This is a reliable process we use in audits:

  1. Check with a raw server request. Use a tool like curl or browser dev tools to load an asset directly from your origin server (bypass the CDN). If the asset is fresh, the CDN is the issue.
  2. Inspect response headers. Look for X-Cache headers. “HIT” means the CDN delivered a cached copy. “MISS” means it fetched fresh from origin. “EXPIRED” means the cache has expired but needs revalidation.
  3. Verify TTL settings. Short TTLs (like 1 hour) force frequent re-fetches but ensure freshness. Long TTLs (like 7 days) improve performance but risk stale content. Choose based on how often your site changes.
  4. Check for query strings and cookies. If your site URLs include random query strings (like ?v=123), many CDNs treat each as a unique resource, bypassing cache. Either normalize your URLs or configure the CDN to ignore query strings.
  5. Test without a CDN. Temporarily disable the CDN by pointing your domain directly to your server. If the issue disappears, you’ve confirmed the CDN is the cause. Then re-enable and adjust settings.

Common Misconfiguration: Browser Cache vs. CDN Cache

People often confuse browser caching with CDN caching. Your browser caches files locally, and if you’ve set a long Expires header, your browser might ignore the CDN’s fresh copy entirely. That’s why sometimes clearing your browser cache fixes the problem even though the CDN was fine.

To avoid this confusion, when you test a CDN fix, clear both your browser cache and the CDN cache. You can also use a private/incognito window to simulate a fresh visitor. For more basics, read our Beginner’s Guide to WordPress Caching to understand the layers.

When All Else Fails: Reconfigure Your CDN Setup

If you’ve tried everything and still face CDN cache issues, consider a fresh start. Reinstall your CDN plugin or reconfigure the CDN service from scratch. Document the settings you use, then reset them to defaults and reconfigure step by step. This often reveals a small mistake like a wrong file path or missing API key.

Also, not all CDNs work the same with WordPress. If you chose a CDN based on price but it doesn’t integrate well, that might be the root cause. We have a guide on How to Choose a CDN for Your WordPress Site that can help you pick one that matches your setup.

Remember: A well-tuned CDN should be invisible to your visitors—they just see fast pages. When it goes wrong, systematic troubleshooting will get you back on track.

Frequently asked questions

How do I clear my CDN cache in WordPress?

You can clear your CDN cache either from your CDN provider’s dashboard (look for ‘Purge Cache’ or ‘Clear Cache’) or via a WordPress caching plugin that integrates with your CDN. Some plugins have a button that sends a purge request automatically.

Why does my CDN serve old CSS but new HTML?

CDNs often cache different file types with separate rules. Your CSS file might have a longer cache duration than your HTML pages. Check your CDN’s TTL settings for each file type, or force a purge of all assets after updates.

Will a CDN affect my WordPress admin area?

It shouldn’t if configured correctly. Most CDN setups only cache static files or entire front-end pages, not the admin area. If you see issues, ensure your CDN or caching plugin excludes wp-admin URLs from caching.

Can a CDN cache cause login issues?

Yes, if login pages are cached. That’s why you should exclude URLs containing login, admin, or cart from caching. Also disable caching for logged-in users. Most caching plugins have options for this.

How long does it take for CDN cache to update?

If you manually purge the cache, it usually updates within minutes but can take longer depending on the provider and region. If you rely on TTL expiration, it updates after the set duration, which could be hours or days.

1 thought on “Solving CDN Cache Issues on WordPress: A Troubleshooting Guide”

Leave a Comment