Skip to content
FunnelGuard

Fix guide by FunnelsGuard

CDN serving a stale page after deploy: how to find and fix it

OPS-107Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

A CDN such as Cloudflare, Fastly, CloudFront or Bunny stores a copy of your page on servers around the world. This is the edge cache. When you deploy a new version, your origin server has the new page, but the edge may still hold the old one until the copy expires or you purge it.

Visitors then see the old page. Some may see the new page while others see the old one, because each edge location expires its copy at a different time. This makes the problem hard to spot from your own browser.

How a stale page reaches visitors
  1. DeployNew page goes live on the origin
  2. CDN edgeStill holds the old HTML copy
  3. VisitorReceives the old page
  4. ConversionOld offer, form or tags used

The deploy works, but the edge cache never learns about it.

Why it costs you leads or sales

Deploys often fix something that matters: a broken form, a wrong price, a missing tracking tag or a new offer. If the CDN serves the old page, that fix never reaches visitors, and you may believe it is live because you see it yourself.

What visitors see after a deploy

Stale cache

  • Old price or expired offer still shown
  • Old form markup posts to a removed endpoint
  • New tracking tag missing from the page
  • Old script file names return 404 errors

Cache purged

  • New price and offer shown everywhere
  • Form posts to the right endpoint
  • Tracking tags load as intended
  • HTML and asset file names match

How to check if your site has it

Check whether the edge is serving an old copy
  1. Compare origin and edge

    Open the page in a private window and view the source. Check that the change you deployed (a new text string or tag) is present.

  2. Read the cache headers

    Run the curl command below. Look for cache status headers such as cf-cache-status: HIT (Cloudflare), x-cache: Hit from cloudfront, or an age value that is larger than the time since your deploy.

  3. Bypass the cache

    Add a random query string, for example ?nocache=123. If that URL shows the new version and the plain URL shows the old one, the cache is stale. Note that some CDNs ignore query strings, so also test from another network or device.

  4. Test from another region

    Edge locations differ. Check from a phone on mobile data or through a different location, since you may be served by a different edge.

Inspect cache headersbash
curl -sI https://www.example.com/landing-page/ | grep -iE 'cache-control|age|cf-cache-status|x-cache|etag|last-modified'
What common cache headers tell you
HeaderWhat it means
cf-cache-status: HITCloudflare served its stored copy
cf-cache-status: DYNAMICNot cached, fetched from origin
age: 86400The copy is about 24 hours old
cache-control: max-age=...How long it may be reused before checking again
x-cache: Hit from cloudfrontCloudFront served a stored copy

How to fix it

The immediate fix is to purge the stale URLs. The lasting fix is to stop the CDN holding HTML for long, and to purge automatically when you deploy. Menu names differ by provider and plugin version, so check your own dashboard.

Fix a stale CDN page
  1. Purge the affected URLs

    In your CDN dashboard, purge the changed pages first. Purge everything only if many pages changed, because it makes the origin handle a burst of requests.

  2. Set sensible cache headers for HTML

    Send Cache-Control: no-cache (revalidate each time) or a short max-age for HTML. Keep long max-age values for fingerprinted assets such as app.3f9a1c.js.

  3. Use versioned asset file names

    Make your build add a hash to CSS and JS files so a new deploy produces new URLs and old HTML never points to a replaced file.

  4. Purge in the deploy pipeline

    Add a purge call as the last step of your release so nobody has to remember it.

  5. Check page rules that cache HTML

    If you use a rule such as Cache Everything, set an Edge Cache TTL that fits how often you change the page, or exclude pages that change often.

Purge and cache settings by platform
  1. Purge from your cache plugin

    In your caching plugin (WP Rocket, W3 Total Cache, LiteSpeed Cache and similar), use the clear or purge all cache option after each update. Menu names vary by plugin.

  2. Purge the CDN too

    Plugin cache and CDN cache are separate. If you use Cloudflare, clear it from the Cloudflare dashboard or its official plugin's purge option.

  3. Enable automatic purge

    Most cache plugins can clear a page's cache when you update it. Turn that setting on and test it by editing a page.

Purge specific URLs on Cloudflare after a deploybash
curl -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/purge_cache" \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"files":["https://www.example.com/","https://www.example.com/landing-page/"]}'
Revalidate HTML, cache hashed assets for a yearnginx
location ~* \.(html)$ {
  add_header Cache-Control "no-cache";
}
location ~* \.(js|css|woff2)$ {
  add_header Cache-Control "public, max-age=31536000, immutable";
}

How to confirm it's fixed

Confirm the new version is live
  • The curl headers show a fresh age value or a MISS/EXPIRED status after the purge
  • The new text, price or tag appears in the page source in a private window
  • The plain URL and the ?nocache=123 URL show the same content
  • The page looks the same from mobile data and a second location
  • Your form submits and the test lead reaches your inbox or CRM
  • Your tracking hits fire on the page (check in the browser Network tab)

How to prevent it happening again

Make purging part of the release, not a manual chore. Keep HTML on short or revalidated cache rules and let only fingerprinted files live long at the edge.

How a stale page unfolds (Example)
  1. 10:00

    You deploy a fix for the quote form. It works on the origin.

  2. 10:05

    You check the page in your browser and it looks right, because your edge has refreshed.

  3. 10:30

    Other edge locations still hold the old HTML and the old form.

  4. Next day

    Leads are lower, but nobody connects it to the deploy.

  5. Next day

    You purge the cache and the new page reaches everyone.

Prevention checklist
  • Add a CDN purge step to your deploy pipeline
  • Send no-cache or a short max-age on HTML
  • Use hashed file names for CSS and JS
  • Keep old asset files available for a short time after each deploy
  • After every release, check the live URL from outside your network
  • Review any Cache Everything rule and its Edge Cache TTL

How FunnelGuard handles this

FunnelGuard detects this issue only partly. It checks whether the page's DOM (the structure of the rendered page) hash has stayed unchanged, and it runs text assertions, which look for text you expect on the page. If a deploy should have changed the page but the hash is unchanged, or the expected text is missing, you get an alert.

What it does not do: it does not read your CDN's cache headers, tell you which edge location holds an old copy, or purge anything. It also cannot know that a deploy happened unless you set up a text assertion for the new content. Pages that change on their own, such as rotating banners, can make a hash a weaker signal.

To cover the rest by hand, run the curl header check after each release, test with a ?nocache= query string, and look at the page from a second network. Add a purge step to your deploy pipeline. A robot visitor runs your real journeys on a schedule from the EU or the US, and a failure is re-checked from a second region before one alert goes out with a screenshot and a likely cause. The Free plan covers 1 site and 2 journeys with daily checks and needs no card, and a free read-only website audit is available.

Frequently asked questions

Questions people ask

Why is my website still showing the old version after I updated it?

Most often a cache holds the old copy. It may be your CDN, a cache plugin, the host or your own browser. Purge the CDN for the changed URLs, clear any plugin cache and reload in a private window.

How do I purge the Cloudflare cache after a deploy?

In the Cloudflare dashboard, open Caching, then Configuration, then Purge Cache, and purge by URL or choose Purge Everything. You can also call the purge_cache API from your deploy script with a zone ID and an API token.

How can I tell if my CDN is serving a cached page?

Request the page with curl -I and read the headers. A cf-cache-status of HIT, an x-cache hit value or a high age value means the response came from the cache. Comparing the page with a ?nocache=123 URL also helps.

Should I cache HTML pages on a CDN?

You can, but only with a short lifetime or revalidation, and with a purge on every deploy. HTML changes often and links to assets that may be replaced. Long cache times are best kept for hashed CSS, JS and images.

Why do some visitors see the new page and others the old one?

CDNs keep separate copies at many edge locations, and each copy expires at its own time. Until you purge, visitors in some places get the new page and others the old. Check from another region or network to see it.

Can a stale cache break my forms and tracking?

Yes. An old page may post to a removed endpoint, miss a new tracking tag, or load script files that no longer exist. Leads and conversions can then drop without any visible error on the page.

Can FunnelGuard detect a stale CDN page?

Partly. It checks whether the DOM hash is unchanged and runs text assertions, so it can flag a page that still shows old content. It does not read CDN cache headers or purge the cache for you.

How do I stop a CDN serving old pages in future?

Add a purge step to your deploy pipeline, send no-cache or short max-age on HTML, and use hashed names for assets. Then check the live page from outside your network after each release.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: DOM hash unchanged / text asserts.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.