Cache Deception showing HIT status for invalid URL

I have the following caching rule applied

But when an invalid request is sent

https://app.scanova.io/:invalid.css

The Cf-Cache-Status: for the first request is MISS but for the subsequent requests, the status is HIT.

Also the Content-Type: header is text/html.

Does this mean the cache deception is not working? or is there any configuration change required?

Hi there,

The URL replies with a 200 status code, so naturally Cloudflare caches it:
Screenshot 2024-06-25 at 17.02.08
My advice is that you have the 404 page actually sending a 404 status, this way it will only cache for 3 minutes, but you can customize this with cache rules:

Take care.

1 Like

In frontend using Angular (SPA) which will always return 200 responses because not found is handled on the client side. The page shown is 404 page only but the status code is not 404.

This topic was automatically closed after 14 days. New replies are no longer allowed.