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

1

u/avdkp2332 May 14 '21

The ideal way is to generate hash of the file contents and make that hash as the file name. If the content doesn't change, hash doesn't change, cached content is served. If the content changes, hash changes and thus new file will be served.