Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A successful deploy does not prove that a request is reaching the new page. The 404 may be a cached response at Cloudflare’s edge, or the current origin or deployment may still be resolving that path as missing. First check what the origin serves; then investigate cache status and rules, purge the right object if needed, and verify the next response.

Why a 404 can remain after a deploy

Cloudflare documents a default Edge Cache TTL of three minutes for 404 and 410 responses when the origin does not send Cache-Control or Expires. That is a default, not a fixed limit: response headers and Edge TTL Cache Rules can change how long a response is cached. Cloudflare’s cache-by-status-code guidance explains the behavior.

A deploy only helps if the request reaches a working route in the deployed environment. A cached negative response is one possibility; a missing file, incorrect path, rewrite, or application route at the origin is another. Check the origin before purging so you do not simply recache the same 404.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check whether the origin serves the page

  1. Request the affected path directly from the origin, bypassing Cloudflare where your setup permits. Confirm that the hostname, path, and deployment environment match the intended site.
  2. If the origin returns 404 too, inspect the deployed artifact, route mapping, rewrite rules, and application behavior. Fix the origin or deployment first; a cache purge cannot create a missing page.
  3. If the origin serves the page, move on to the Cloudflare response headers and the rules that apply to the request.

If the site uses Cloudflare Pages

Pages serves a matching file when one exists and supports custom not-found handling with a 404.html. A top-level 404.html also changes the routing behavior: without one, Pages assumes a single-page application and sends incoming paths to the root for client-side routing. Check whether the file and routing mode match the application you deployed. See Cloudflare Pages’ serving documentation.

Also inspect Cache Rules on a Pages custom domain. Cloudflare warns that a cached response can be served before Pages processes the request, potentially affecting redirects and Pages Functions. This Pages-specific behavior should not be assumed for a separate origin merely proxied through Cloudflare.

Read the cache status and inspect matching rules

Inspect the response’s CF-Cache-Status header. These values describe Cloudflare’s cache decision for that request; none by itself proves that the deployed route works at the origin.

Header value What it indicates
HIT A cached response was served. If it contains the old 404, investigate the cache object and its key, while confirming the origin still serves the page.
MISS The response was eligible for caching but was not present in cache when requested.
DYNAMIC The request was not eligible for cache at request time.
BYPASS The request was eligible, but a response directive or configuration prevented caching.

Cloudflare does not cache HTML or JSON by default based on file extension. A Cache Rule can make additional content eligible, while bypass rules, request method, Development Mode, and response cache headers can also affect caching. Use Cloudflare Trace to see which Cache Rules match the affected request. Definitions of cache-status values are in Cloudflare’s cache response documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a purge or invalidation that matches the problem

Option What it does When it fits Trade-off
Purge by URL Removes the matching cached resource; the next request fetches a full response from the origin. One known route is stale and the purge selector matches its cache key. May miss the object if a custom key includes dimensions the purge request does not specify.
Invalidate Marks matching content stale for revalidation. You want revalidation and can tolerate stale serving during revalidation or an origin error. Stale content may remain available while revalidation occurs or if the origin fails.
Purge Everything Clears cached resources for the zone. Cloudflare Pages’ guidance for stale assets after deployment, or when a narrower selector cannot clear the relevant object. Requests must be served from the origin until the cache repopulates, which can increase origin load and affect performance.

For a single ordinary page, Cloudflare recommends purging the exact URL. The next request fetches the full response from the origin and may repopulate the cache in the data center serving that request. Cloudflare distinguishes purging from invalidation: invalidation retains the object as stale and revalidates it on a later request. See Cloudflare’s purge documentation.

For stale assets after a Pages deployment, Pages’ serving guidance recommends Purge Everything. Because that clears the zone’s cached content, use it for that documented Pages case or when a targeted purge cannot address the object—not as the default remedy for every stale 404. See Cloudflare Pages’ serving documentation and Cloudflare’s purge guidance.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify the result—and investigate if the old 404 remains

  1. After the purge, request the affected URL again and inspect CF-Cache-Status. Cloudflare advises verifying that the response is no longer HIT.
  2. Check the response body and status as well as the header. A successful purge request only confirms Cloudflare received the request; it does not prove that the object was cached or evicted.
  3. If the old result persists, check whether the Cache Rule uses a custom cache key containing headers, cookies, or other request properties. A dashboard single-file purge may not match keys with values it cannot send.
  4. Choose a purge method that covers the actual key and scope. Depending on the configuration, Cloudflare documents using a complete API URL/key, hostname, prefix, tag, or full purge. If a URL path is transformed, a prefix purge may need the post-transformed origin URL.

Cloudflare’s purge guide describes verification and purge options. For transformed URLs and purge-key details, see purging by prefix and purging by cache tag.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.