Cloudflare is not caching css files automatically

There are a lot of stuff Cloudflare is not caching by default, is there a way to cache everything sent with those headers?

Also why Cloudflare is not caching and minifying some.css and .js even with a page rule? Does it looks only to the URL? the URL ends with .json, but not all end with .css but the headers says content-type: text/css; charset=utf-8 but still not caching or minifying.

Thanks <3

https://support.cloudflare.com/hc/en-us/articles/200172516-Which-file-extensions-does-Cloudflare-cache-for-static-content- should answer these questions.

1 Like

Yeah, according to that link it should be caching my css files but it’s not…does it look at the content-type or cache-control or just the URL alone?

The specific URL is this: domain.com/Content/css?v=1yzajkz16lM8sGokHsB5AJr34RnlAdxCVsc6jnynWOA1

I don’t like using a page rule to cache something that should be cached already…I rather learn why this happens and how I can fix it.

Thanks!

The URL you mentioned does not have one of the cached extensions, so it wont be cached. You would need to rename it to css.css for it to be cached.

Ok. Thanks that proves my theory that it’s only looking at the URL itself. Why not use the content-type headers?

See my first link please.

Cloudflare does not cache by MIME type at this time.

Ah ok. My bad for not knowing this = content headers in the requests sorry.

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