Fix a cache that serves old content

We'll confirm the origin has new content, clear the browser cache, fix Cache-Control headers, or purge the CDN so users see the latest version.

Category
Troubleshooting · Home maintenance
Time
10–25 min
Last reviewed
What you'll need
  • Access to the server or CDN (to fix headers or purge)
  • Browser DevTools to inspect Cache-Control and clear cache

Step-by-step diagnostic

Show full guide

Steps

Goal: Confirm the origin has new content, clear the browser cache, fix Cache-Control headers, or purge the CDN so users see the latest version.

  • Verify the origin server has the new content when cache is bypassed (curl or incognito with cache disabled).
  • Good: Origin has new content—cache is the issue. Proceed to Confirm origin.
  • Bad: Origin still serves old—fix deployment first.

Confirm origin has new content

Goal: Rule out deployment before fixing cache.

  • Use curl with Cache-Control: no-cache or open the URL in incognito with DevTools > Network > Disable cache.
  • Good: Origin has new content. Proceed to Clear browser cache or Purge CDN based on where the cache is.

Clear browser cache

Goal: Test with a fresh browser cache and fix headers for future updates.

  • Hard refresh: Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (Mac). Or DevTools > Application > Storage > Clear site data.
  • For ongoing fixes, set Cache-Control: no-cache or short max-age for content that changes often. Use cache-busting (versioned URLs) for static assets.
  • Good: Users see new content. Bad: CDN may also be caching—purge it.

Fix Cache-Control

Goal: Set headers so the browser and CDN do not cache content too long.

  • HTML and dynamic content: no-cache or max-age=0. Static assets that change: use a versioned URL (app.js?v=123) and set long max-age; the new URL bypasses cache.
  • Restart the server and retest. You should see the correct headers in DevTools > Network > Response Headers.
  • Good: Headers are correct. Bad: CDN may have its own cache—purge it.

Purge CDN

Goal: Invalidate the CDN cache for updated URLs.

  • Log into the CDN dashboard (Cloudflare, Fastly, etc.). Use Purge or Invalidate. Purge by URL or path prefix. Purge only what changed.
  • Wait a few minutes and retest. You should see the new content.
  • Good: CDN serves fresh content. Bad: Purge may take time—retest. If it persists, check for intermediate caches.

When to get help

  • You have cleared browser cache, fixed Cache-Control, and purged the CDN and users still see old content. Capture response headers, CDN purge log, and affected users. Check for reverse proxy or WAF cache. Contact hosting or CDN support.

Verification

  • The origin serves new content when cache is bypassed.
  • The browser and CDN serve new content after clear or purge.
  • Cache-Control headers match the update frequency of each resource type.

Escalation ladder

Work from the device outward. Stop when the problem is fixed.

  1. Confirm origin Verify the origin server has the new content when cache is bypassed.
  2. Clear browser cache Hard refresh or clear site data to test with fresh cache.
  3. Fix Cache-Control Set no-cache or short max-age for content that changes often.
  4. Purge CDN Purge the CDN cache for updated URLs.
  5. Cache-busting Use versioned URLs for static assets.
  6. Contact support Escalate with headers, purge log, and affected users.

What to capture if you need help

Before calling support or posting for help, have these ready. It speeds everything up.

  • Cache-Control header from the response
  • CDN provider and purge status
  • Whether the origin serves new content when cache is bypassed
  • Steps already tried

Does the origin server have the new content when cache is bypassed?

Use curl or incognito with cache disabled. If the origin serves old content, the problem is deployment, not cache.

Use curl -H "Cache-Control: no-cache" <url> or open the URL in incognito with DevTools > Network > Disable cache. Good: origin has new content—cache is the issue. Bad: origin still serves old—fix deployment first.

You can change your answer later.

Is the stale content from the browser or a CDN?

Browser cache: clear site data or hard refresh. CDN: purge the cache. Both: do both.

If only you see old content after clearing your browser cache, the CDN may be serving stale. If you use a CDN, purge it. If no CDN, the browser cache is the culprit. Good: you know the source. Bad: try both—clear browser and purge CDN.

You can change your answer later.

Clear browser cache and fix Cache-Control

Hard refresh or clear site data. Then fix Cache-Control so future updates are not cached too long.

Clear the browser cache: Ctrl+Shift+R or DevTools > Application > Clear site data. Then fix Cache-Control on the server: use no-cache or short max-age for content that changes often. Good: users see new content. Bad: check for intermediate caches.

Purge CDN and fix Cache-Control

Purge the CDN for updated URLs. Fix Cache-Control so the CDN does not cache too long.

Use the CDN purge feature for the updated URLs. Fix Cache-Control so the CDN uses a short max-age or no-cache for dynamic content. Use cache-busting for static assets. Good: CDN serves fresh content. Bad: purge may take a few minutes—retest.

Fix deployment first

If the origin serves old content, the cache is not the problem. The deployment or build may not have updated the origin.

The origin server does not have the new content. Check your deployment pipeline, build output, and that the correct files were deployed. Fix the deployment before troubleshooting cache.

Reviewed by Blackbox Atlas

Frequently asked questions

Why would a cache serve old content?
The browser, CDN, or proxy stores a copy of the response. If Cache-Control allows long storage (max-age) or the CDN has not been purged, the cache returns the old copy until it expires or is purged.
What is Cache-Control and when should I use no-cache?
Cache-Control tells the browser and CDN how long to store the response. no-cache means revalidate with the server before using. no-store means do not store. max-age=3600 means store for 1 hour. Use no-cache or short max-age for content that changes often.
How do I purge a CDN cache?
Log into the CDN dashboard (Cloudflare, Fastly, etc.) and use the purge or invalidate feature. Purge by URL, path prefix, or everything. Purge only what changed to avoid overloading the origin.

Rate this guide

Was this helpful?

Thanks for your feedback.

Continue to