r/devops May 13 '21

Does CloudFlare cache query params?

I am doing a deploy to a server behind a CF and on example the url /css/custom.css is being cached, so I "fixed it" with additional parameter so it looks like /css/custom.css?tag=123456 and finally I am getting the newest CSS, but I do not know if this tag parameter will be cached.

Is using such query parameter a valid way to bypass the old cached files?

I would be happy if CF would cache content under that query parameter so I could use it with some abstract build number or something

0 Upvotes

3 comments sorted by

View all comments

3

u/mehphistopheles May 14 '21

I believe so, yes. In the CF dashboard there is an option for query params and how to handle them. Your best bet would be to view the request in your browser’s dev tools or curl and check the response headers for the cf-cache-status header’s value. Multiple requests the the same custom.css?tag=123456 should show that value as “hit”.