Mobile app version of vmapp.org
Login or Join
Jessie594

: “Resources with a "?" in the URL are not cached by some proxy caching servers” I'm using query strings to burst out of cache, e.g.: mysite.css?201708311009 where the date is that of the

@Jessie594

Posted in: #Cache #Cdn #QueryString

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jessie594

1 Comments

Sorted by latest first Latest Oldest Best

 

@Phylliss660

From bizcoder.com/caching-resources-with-query-strings:

Steve demonstrates when using a version number in the query string, the Squid proxy cache does not cache the static file at all. He goes on to say that Squid can be configured to cache these files, but it is not the default behaviour. Based on this information, he rightly suggested that people don’t use versions in their query string if they want to cache static resources.

That was in August 2008. Earlier that year, in May 2008, Squid released version 2.7 which changed their default behaviour to no longer refuse to cache URLs that contained a query string.


So the (not exhaustive) answer is: really old versions of what I believe is the most popular proxy software.

Personally I use the same solution Stephen Ostermiller mentioned in the comments - use rewrite rules to include a hash in the filename, although that isn't always possible. I wouldn't be too concerned if you're using query strings.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme