I'm using query strings to burst out of cache, e.g.: mysite.css?201708311009 where the date is that of the last modification date of the file.
Running a speed test on PingDom gets me this result:
Resources with a "?" in the URL are not cached by some proxy caching servers. Remove the query string and encode the parameters into the URL for the following resources:
I'm unsure what to make of it.
On the one hand, it might defeat the whole purpose of caching, if it's true. However:
- They don't back up their claims with facts or sources.
- Apparently, Google PageSpeed Insight used to give the same advice but they stopped.
- Major CDNs (ex: maxcdn) recommend the use of query strings to manage asset versions and those who give a word of caution (ex: keycdn) don't back up the claim.
- WordPress relies on query strings for cache busting and powers 25% of websites. (It doesn't necessarily mean it's a best practice, but it's something.)
My question is two-fold:
- What are some known cases of query strings causing caching issues with proxy caching servers? (If none can be found, then the whole thing is just a rumor.)
- If it is an issue, are there alternative, besides changing the filename*? e.g.: are URL fragments acceptable (
mysite.css#201708311009)?
*I'd rather avoid changing filenames for this if I can afford it because it's more of a burden to handle.
mysite-201708311009.cssfor this reason. I started doing so years ago, and I don't know if it is still necessary to do so for caching. – Stephen Ostermiller Aug 31 '17 at 11:48