Hot to configure cache rules

I want to cache my blog’s static files, include css and js. But when I configure it in dashboard cache rules like this:

Then I check my browser’s control panel and found my website’s css cache control is
cache-control: public, max-age=0, must-revalidate

My blog is deploy on Cloudflare pages so I think I should be follow the rules by cloudflare’s cache control. But it not work…

Or Could you tell me how to cache correctly?

Hey, anyone else?

Request headers do not have a content-type (at least not GET requests), so what you did there will not work.

You can try something like If Uri.Path ends with .css or something like that.

I think I know what you mean. You mean content-type is server response to client, not client request server?
I will try your solution immediately.

Yes, exactly that.

Former question be solved like:

(ends_with(http.request.uri.path.extension, "css")) or (ends_with(http.request.uri.path.extension, "js"))

image

Thanks for your help sir! Have a nice day!

1 Like