If you just want to strip certain query parameters, then use Transform Rules to strip the params you do not want. This can also be used to selectively remove query strings from certain assets (so you can target all .css files to remove all query strings).
I’m using query parameters add-to-cart, for example. I understand how I could use caching levels to achieve what I want, but I’m afraid that only works if you don’t use query parameters on your website. I can’t find that setting under page rules.
Thank you very much for your help. That was very helpful. I’ve not yet tried the transform rule idea, but I did set up a worker and it works as the developer toolbar shows cf-cache-status:HIT, even though I have a fbclid or utm-source attached.
However what I wonder is, will tracking still work the same way. I did try it, since I have first party tracking and even though I respond with the cached response the utm parameters were tracked. But I don’t know why. Shouldn’t they stop working if Cloudflare responds with the cached version?
In general, yes. If your Origin server is not varying its response based on the query parameter, then using the query parameter to shard the cache is just a waste of resources.