Cache Rules not working as expected

Hello, here is my cache rules.
When I go to the link mydomain com/img/example.png for example it says cache status dynamic. Same with css and js.

Also, I want the subdomains to not be affected by this and I want the subdomain to be all cached.


If the HTTP cf-cache-status header contains the value DYNAMIC, it means the cache for that particular file isn’t set and is actually bypassed.

It would be cached if it would contain the value HIT.

Furthermore, you’d have to combine AND case with “hostname” contains or vice-versa.

Furthermore, make sure that on the origin itself you’re setting the cache response headers, otherwise add them at Cloudflare and make sure Cloudflare reads and respects them accordingly.

Or, combine two rules (or just one).

That way, you tell the Cloudflare what to cache or not.

Otherway would be to use Transform Rules to make sure that cache HTTP headers cache-control contains value like cache-control: max-age=0, no-cache, no-store, must-revalidate.

For example - apply and don’t cache all under /img/ /css/ and /js/ path for main (naked) domain, however (hopefully the correct cache HTTP headers are set and/or sent) cache them for,,, etc.:

I am trying to make everything on domain com not to be cached and only domain com /img, /css, /js to be cached. I also want cdn domain com to be cached as well. How may I do that?

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