I’m optimizing a website by moving static assets to another domain and server, which will respond with long Expires headers. I’d like to be able to add a version token to the urls to force clients to download a new version, eg. http://static.example.com/foo.min.js?v=123.
Is it still problematic to use a query string in static asset urls? Earlier I’ve seen tutorials telling to avoid query strings in static assets, because some proxies would not cache these urls.
Is this still the case?
Should I use another naming scheme, maybe with some url rewriting on the web server? Eg. http://static.example.com/123/foo.min.js. (To keep the deployment process simple, I don’t want to actually have to create a 123 directory.)
I know this makes quite a simple mod_rewrite (or similar) rule, but I’d like to keep my static asset web server dead simple, and replaceable, that’s why I’d prefer a query string based approach in the first place.
[After a bit more digging…] Yes, it seems that at least Squid still does this. So rewriting it is.Thanks Julian, it really seems the default config has changed four years ago, with Squid 2.7 and 3.1.