Skip to content
FunnelGuard

Fix guide by FunnelsGuard

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

PRF-060High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

A CDN stores copies of your pages and files on servers around the world. When a visitor asks for a page, the nearest server answers without bothering your own server. That is fast, but the copy has a lifetime. Until it expires or you clear it, the CDN keeps handing out the old version.

You update a price, swap a headline or end a sale. Your origin server (the real host) has the new page. The CDN still shows the old one. You often do not notice, because you see the new version when logged in, on another network, or after a hard refresh.

How a stale page reaches visitors
  1. DeployNew price goes live on the origin
  2. CDN edgeStill holds the old cached HTML
  3. Visitor sees old offerOld price or ended promotion shown
  4. CheckoutPrice mismatch or abandoned cart

The origin is updated, but the CDN edge keeps answering with its cached copy.

Why it costs you leads or sales

Visitors act on what they see. If the page shows an old price, one of three things happens: they buy at a price you no longer want to honour, they hit a higher price at checkout and leave, or they see an offer that has ended and lose trust. Ads that promise the new offer but land on the old page make it worse.

It is also hard to spot. Your own team sees the right page, so the problem can run for hours or days. Stale forms and scripts are another risk: a cached page can point to an old form or tracking setup that you already replaced.

Share of visitors seeing the old page after a deployExample numbers
Share of visitors seeing the old page after a deploy (example)0 h: 100 %; 6 h: 75 %; 12 h: 50 %; 18 h: 25 %; 24 h: 0 %0387710075502500 h6 h12 h18 h24 h%

Example: with a 24-hour cache lifetime and no purge, the share of visitors on the old page falls slowly as copies expire at different edges.

How to check if your site has it

Check what the CDN is really serving
  1. Open the page in a private window on mobile data

    Use a network and browser that have never visited the page. Compare price, headline and offer dates with what you just deployed.

  2. Add a random query string

    Load the page with ?nocache=123 on the end. If that shows the new content but the plain URL shows the old one, the CDN is serving a cached copy.

  3. Read the response headers

    In browser dev tools, open the Network tab, click the page request and read the headers. Look for Age, Cache-Control, and a cache status header such as cf-cache-status (Cloudflare) or x-cache (CloudFront, Fastly).

  4. Test from another region

    Use a VPN or an online tool that fetches your URL from other countries. Edges are separate, so one can be fresh while another is stale.

Check cache headers from the command linebash
curl -sI https://example.com/pricing | grep -iE 'cache-control|age|cf-cache-status|x-cache|etag|last-modified'

How to fix it

Clear the stale copy and stop it coming back
  1. Purge the affected URLs

    In your CDN dashboard, purge the changed pages first. Purge everything only if many pages changed, because it temporarily sends all traffic to your origin.

  2. Set a short cache lifetime for HTML

    Keep long lifetimes for versioned CSS, JS and images. For HTML pages with prices or offers, use a short edge lifetime or revalidation so a stale copy cannot live for long.

  3. Version your static files

    Use file names with a hash (app.4f2a1c.js) or a version query string, so a new deploy always asks for new files instead of reusing cached ones.

  4. Purge automatically on deploy

    Add a purge call to your deploy script or plugin settings so the cache is cleared every time you publish.

  5. Purge the browser and page caches too

    Clear any full-page cache plugin or server cache before purging the CDN, otherwise the CDN may re-fetch the old copy from the origin.

Purge and configure by platform
  1. Purge the cache plugin first

    In your cache plugin (WP Rocket, W3 Total Cache, LiteSpeed Cache and similar), clear the page cache, then clear the CDN cache from the same plugin if it has a CDN integration.

  2. Turn on automatic purge

    Enable the option that clears cached pages when a post or page is updated. Check the plugin's cache lifetime setting as well.

  3. Purge the CDN

    If you use Cloudflare, use its dashboard under Caching > Configuration > Purge Cache, or its official WordPress plugin.

Example: short HTML cache, long cache for versioned assets (nginx)nginx
location / {
    add_header Cache-Control "public, max-age=0, s-maxage=300, must-revalidate";
}

location ~* \.(css|js|woff2|png|jpg|webp|svg)$ {
    add_header Cache-Control "public, max-age=31536000, immutable";
}
Example: purge one URL on Cloudflare after 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://example.com/pricing"]}'
Deploy process

Before

  • HTML cached for 24 hours
  • Manual purge, often forgotten
  • Team checks the page while logged in
  • Old price shown to visitors for hours

After

  • HTML edge cache of a few minutes
  • Purge runs automatically on every deploy
  • Page checked from a clean session
  • New price visible within minutes

How to confirm it's fixed

Confirmation checklist
  • Plain URL (no query string) shows the new price and offer in a private window
  • Page loads correctly on mobile data and from a second region
  • Response headers show a recent Age value or a MISS/REVALIDATED status after the purge
  • Cache-Control on HTML matches your intended short lifetime
  • CSS and JS file names changed, and the new files load
  • Price on the page matches price in the cart and checkout
  • Ad landing URLs, including those with UTM parameters, show the new offer

How to prevent it happening again

Make the purge part of the deploy, not a manual job. Keep HTML cache lifetimes short on pages that hold prices, stock or dated offers. Give versioned assets long lifetimes. After every release, open your top landing and pricing pages from a clean session and compare them against the release notes.

A deploy with an automatic purge
  1. 10:00

    New price is deployed to the origin

  2. 10:01

    Deploy script purges the changed URLs on the CDN

  3. 10:02

    First visitor request fetches the new page from the origin

  4. 10:05

    A scheduled check confirms the new price is shown

How FunnelGuard handles this

FunnelGuard detects this issue only partly. A robot visitor loads your pages on a schedule and runs text checks, so if a page should contain a given price, headline or offer wording and it shows the old text, the check fails. A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause.

Cover the rest by hand
  • After each deploy, check the cache headers (Age, Cache-Control, cache status) on key pages
  • Compare the live page with your release notes from a clean browser session
  • Test from at least two regions, as edges can differ
  • Check that prices in ads, on the page and in the cart agree
  • Keep a note of which pages hold prices or dated offers so you know what to purge

The Free plan covers 1 site and 2 journeys with daily checks, no card needed. Paid plans have a 3-day free trial.

Questions people ask

Why is my website showing old prices after an update?

Most often a CDN or cache plugin is still serving a saved copy of the page. Your origin server has the new content, but the cached copy stays until it expires or you purge it. Purge the page in your CDN and cache plugin, then reload in a private window.

How do I clear the CDN cache after a deploy?

Open your CDN dashboard and use its purge option for the changed URLs, or call its purge API from your deploy script. Clear any server or plugin page cache first, so the CDN does not fetch the old copy again.

How can I tell if a CDN is serving a stale page?

Load the URL with a random query string such as ?nocache=123 and compare it with the plain URL. Also read the response headers: a cache status of HIT and an Age value older than your deploy time means the copy is stale.

How long should I cache HTML pages on a CDN?

For pages with prices, stock or dated offers, keep the edge lifetime short, for example a few minutes, or use revalidation. Long lifetimes suit versioned CSS, JS and images, whose file names change on each deploy.

Should I purge the whole CDN cache or just some URLs?

Purge only the changed URLs when you can. A full purge sends all traffic to your origin at once, which can slow the site. Use a full purge when many pages or shared templates changed.

Why do I see the new page but customers see the old one?

You may be logged in, on a different network, or bypassing the cache with a hard refresh. Cached copies can also differ between CDN locations. Check from a private window, mobile data and another region.

Can FunnelGuard detect a stale CDN page?

Partly. It runs text checks on your pages, so it can flag old prices or offer wording that you told it to expect. It does not inspect CDN settings or cache headers, so check those by hand after deploys.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: text checks catch stale content.

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.