How to disable caching based on response status

Cloudflare is caching any page with status 404 for 48 hours.
Even If I disable the cache and by pass the cache and purge everything it still cache the 404 response page!

How to completely disable caching based on response status?

That cache duration is not standard behaviour for 404s, so check whether your Origin is adding that long a cache-control max-age. The default for 404s without cache-control or Expires headers is 3m.

Enterprise plan have a Configure Cache by Response Code option.

You could try using a HTTP Response Header Transform, which enables you to target specific response headers, including the response code.

1 Like

If cache is bypassed then it is the origin which has cached the 404 page.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.