Cloudflare Pages shows the latest deployment with a green "Success" badge, but your site still shows yesterday's page. You hard-refresh, ask a colleague to check, and they see the old version too. This is one of the more confusing support conversations, because the dashboard is technically telling the truth. A successful deployment only means a build ran and produced files. It says nothing about which files a visitor's browser receives.
The rest of this article is written as a post-mortem of a typical incident of this kind, organized by stage of the investigation. It is a composite of a common pattern, not a record of one specific event.
Initial impact: a green deploy and an old site
The symptom usually reaches support as "my changes aren't showing." The content change is visible in the repository, the commit triggered a build, and the deployments list shows it as successful. On the production domain, though, the old headline, the old pricing, or the old JavaScript bundle is still there.
Two variants show up. In the first, the site is stale: it looks exactly like the previous release. In the second, the site is broken in a new way, often a blank page or a 404, even though the deploy succeeded. The second variant has a different cause, which comes up later.
The first useful question is not "is it cached?" but "which layer is answering?" Between the build and the visitor there are several places where an old copy can live:
- The build itself, which may have restored stale output from its build cache.
- The deployment, which may have gone to a branch that is not production.
- The Cloudflare edge for your custom domain, if zone-level cache rules apply.
- The browser cache.
- A service worker registered by the site.
Investigation: ruling out layers one at a time
The fastest step is the cheapest one: open the site in a private or incognito window. Cloudflare's community guidance for blank or stale Pages sites starts there too. If the private window shows the new version, the problem is on the client side, either browser cache or a service worker, and the edge is fine. If the private window also shows the old version, the problem is upstream.
The next step is to compare the production URL with the deployment's own URL. Every Pages deployment gets a unique preview address, shown in the deployments list, in the form <hash>.<project>.pages.dev. That URL points at exactly one build artifact, so it is the ground truth for what that build produced.
Compare the response headers from both:
# Production domain
curl -sI 'https://www.example.com/' | grep -iE 'cf-cache-status|age|etag|cache-control'
# Unique deployment URL copied from the Pages deployments list
curl -sI 'https://abc123.my-project.pages.dev/' | grep -iE 'cf-cache-status|age|etag|cache-control'
The headers mean the following:
cf-cache-statustells you whether Cloudflare served the response from its cache.HITmeans it came from cache.MISSorDYNAMICmeans it was fetched fresh.ageis how many seconds the cached copy has been sitting at the edge.etagis a fingerprint of the content.
If the two etag values differ and production shows HIT with a large age, the production domain is serving a cached copy from before the deploy. The earlier article on reading cf-ray and cf-cache-status headers covers these headers in more depth.
If the unique deployment URL itself shows the old content, the edge cache is not the problem. The build produced old files, and the cause is earlier in the pipeline.
The discovery: which artifact is actually served
In this kind of incident, the turning point is usually one of three findings.
The deploy went to the wrong branch. Pages treats one branch as production. Pushes to any other branch create preview deployments that also show "Success" but never touch the production domain. Teams that recently renamed master to main, or that merged into a staging branch, often hit this. Check which branch the successful deployment was built from and compare it with the production branch set in the project's build settings.
The build cache restored stale output. Pages can keep a build cache between builds so that dependency installs and framework caches don't start from zero each time. That speeds up builds, but if a framework writes generated pages into a cached directory and its own invalidation misses a change, the build can finish quickly and successfully with old output. A hint that this is happening: the build log is suspiciously fast, or it reports that pages were restored from cache. The fix is to clear the build cache in the project settings and retry the deployment.
The output directory is wrong. This produces the blank page or 404 variant rather than stale content. In the Cloudflare community threads about deployments that show success but return an empty response or 404, the recurring explanation is that the build command ran fine but Cloudflare could not find any HTML in the configured output directory. A framework that writes to dist while the project expects build will fail this way. Direct Upload has a related trap: uploading a zip or folder that wraps the site in an extra parent directory, so index.html is not at the root.
When support engineers handle this ticket, comparing the unique deployment URL with production is usually the first thing they check, because it splits the problem in half with one request.
Temporary mitigation: purge, clear, and redeploy
Once you know which layer is stale, the mitigation depends on that layer.
If the build cache is the culprit, clear it from the Pages project settings and use Retry deployment on the latest commit. Confirm on the new unique deployment URL that the content is correct before you look at production.
If the zone cache on your custom domain is the culprit, purge it. This usually happens when someone added a Cache Rule such as "Cache Everything" on the hostname that points at Pages. Purging single URLs is the lower-impact option. A full purge is fine for a static site, but on a zone that also fronts a dynamic origin it sends a burst of uncached traffic to that origin. You can purge from the zone's Caching settings in the dashboard, or through the API:
# Purge specific URLs. Token needs the Zone > Cache Purge permission.
curl -s -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/index.html"]}'
Keep the token in an environment variable or a secret store. Don't paste it into scripts or chat logs.
If the problem is a bad release rather than a stale one, Pages lets you roll back production to an earlier successful deployment from the deployments list. That buys time while you fix the build.
If only some users see old content and private windows look correct, look for a service worker. Purging Cloudflare will not help, because the service worker answers before the request ever leaves the browser. Each affected user has to unregister it, or you have to ship a service worker update that replaces it.
Architectural fix: make the served version observable
The real gap in this incident is that nobody could tell which build was live without comparing page content by eye. The long-term fix is to stamp every build with its commit and expose that stamp on a URL you can query.
Pages exposes the commit hash to the build as an environment variable, so you can add it to your build command:
# Build command in Pages settings (adjust 'dist' to your output directory)
npm run build && echo "$CF_PAGES_COMMIT_SHA" > dist/version.txt
# After deploy, compare against the commit you expect
curl -s 'https://www.example.com/version.txt'
Now "is the new version live?" has a one-line answer, and a CI step or uptime check can compare it with the expected commit after each deploy.
Beyond that, a few defaults prevent most repeats:
- Give HTML short or no-cache
Cache-Controlheaders. Let only content-hashed assets, such asapp.3f9c2a.js, be cached for a long time. Pages supports a_headersfile for setting this per path. - Avoid broad "Cache Everything" rules on a Pages hostname unless you also purge on every deploy. Pages manages caching for its own deployments, and a zone rule on top adds a layer it doesn't control.
- Write down which branch is production and which output directory the framework uses, so a framework upgrade or branch rename doesn't silently change either.
A green deploy badge tells you the build finished. To know what visitors get, check the unique deployment URL first, then the production headers, then the browser. Once each build carries its commit hash, that check becomes a single request.