October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Cloudflare Cached Our 404s: Why a New Page Kept Returning 404 After a Good Deploy

A new page that keeps returning 404 after a good deploy may be a cached negative response at Cloudflare or a route the origin still cannot resolve. Here is how to tell which, and how to purge and verify.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A new page that still returns 404 after a successful deploy usually has one of two causes. Either Cloudflare is serving a cached negative response, or the origin still does not resolve the path to the new page. A good deploy does not tell you which one is happening, so check the origin first, then the cache, then purge only the object that is stale and verify the next response.

Cloudflare documents a default Edge Cache TTL of 3 minutes for 404 and 410 responses when the origin sends neither a Cache-Control nor an Expires header (documented by Cloudflare in 2026). That default is short, but it is not a fixed ceiling. Explicit cache headers and Edge TTL Cache Rules can change how long a negative response stays in cache, in either direction.

As an Amazon Associate I earn from qualifying purchases.

Start with the origin, not the cache

Before touching Cloudflare settings, establish what the origin serves for the exact URL. A cache can only hide a fix; it cannot create a page that the origin does not have.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Request the affected path directly from the origin, bypassing Cloudflare where your setup allows it. Use the same host name, path, and deployment environment you intended to publish.
  2. Read the status code. If the origin returns 200 with the new content, the origin is correct and the problem is at the edge. Go to the cache checks below.
  3. If the origin still returns 404, stop. Purging the cache will not help until the origin resolves the path.

When the origin is still returning 404, the usual causes are:

  • The deploy artifact does not contain the new file, or it was written to a different output directory than the one being served.
  • A route mapping, rewrite, or redirect rule sends the request somewhere other than the new file.
  • The application itself returns 404 for the path because of a routing table, a missing data record, or a conditional that was not updated.

Cloudflare Pages: check routing before cache

If the site runs on Cloudflare Pages, the routing behavior is platform-specific and should be checked on its own terms. Pages serves a matching file when one exists. Its not-found behavior can use a nearby 404.html or a top-level 404.html.

Whether a top-level 404.html exists changes the routing mode. Without one, Pages assumes the project is a single-page application and sends incoming paths to the root so client-side routing can handle them. A page that was deployed as a static file but is requested under a path the SPA does not expect can therefore appear missing even though the file is present.

Custom Cache Rules on a Pages custom domain deserve a specific check. Cloudflare warns that such rules can serve a cached response before Pages processes the request, and that they can interfere with redirects and Pages Functions. If a redirect or Function changed behavior after a cache rule was added, treat the rule as a suspect.

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

Read CF-Cache-Status to see the cache decision

The CF-Cache-Status response header records how Cloudflare handled the request. The values below matter most for this problem.

  • DYNAMIC: Cloudflare determined that the request was not eligible for cache before it looked up an object.
  • BYPASS: The response was eligible, but a response directive or configuration decided not to cache it.
  • MISS: The response was eligible for cache, but no object was present when the request arrived. The response then comes from origin.
  • HIT: The response was served from cache. This confirms a cached copy exists, but it does not show whether the origin is correct. Only the origin check does that.

Cloudflare does not cache HTML or JSON by default based on file extension. A Cache Rule can make additional content eligible. A bypass rule, the request method, Development Mode, or the response’s own cache headers can each change the decision. To see which Cache Rules match the affected request, use Cloudflare Trace for that URL rather than inferring the answer from the rule list.

Purge the narrowest object that fits

Single-file purge for one URL

For an ordinary page, purge the exact URL. Cloudflare recommends single-file purging. The next request fetches the full response from origin, and that response can repopulate cache in the data center serving the request. This is the lowest-impact option because it touches only the stale object.

Purge Everything for stale Pages assets

Cloudflare’s Pages serving guidance says to use Purge Everything when stale assets remain after a deployment. This clears all cached content for the zone. Until the cache repopulates, requests must be served from origin, so origin load can rise and the site can be slower for a period. Use it when the Pages guidance applies or when no targeted selector can clear the object. It is not a default step for every site.

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

Purge or invalidate

Choose purge when stale content must not be served again. Invalidation keeps the object and marks it stale, then revalidates it on the next request. During revalidation, or if the origin fails, stale material can still be served. If the goal is to stop a specific wrong 404 from being returned, purge is the correct choice.

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

Verify the next response, not the API result

A successful purge API response only confirms that Cloudflare received the purge request. It does not prove the targeted object was cached or evicted. After purging, request the URL again and check CF-Cache-Status. The header should no longer show HIT for the object you purged. If the response is now 200 from origin, the fix is complete.

If the old 404 still returns, the most common reason is a custom cache key. When a Cache Rule keys on headers, cookies, or other request properties, a dashboard single-file purge may be unable to send those values and therefore may not match the object. In that case, use one of the alternatives that fit the key and scope: a complete API URL or key, the hostname, a prefix, a cache tag, or a full purge. If a URL transform changes the path before the request reaches origin, a prefix purge must use the post-transformed origin URL, not the path the visitor typed.

Choose the layer you are changing

Choice What it does Use it when Trade-off
Purge by URL Removes the specific cached resource. The next request fetches it from origin. One known route is stale and the selector matches the cache key. Can miss the object if custom cache-key dimensions are omitted.
Invalidate Marks matching content stale so it is revalidated on the next request. You want revalidation behavior, and stale serving during revalidation or origin errors is acceptable. Does not guarantee that stale content stops being served immediately.
Purge Everything Clears all cached resources for the zone. Cloudflare Pages guidance for stale assets after a deployment, or no narrower selector can address the object. Every request goes to origin until the cache repopulates, which can raise origin load and slow the site.

“

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.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.