Could anyone explain how to make sure that if I update my webapp, the user gets the latest version of files?
Should I add a dynamic string ?version=random
at the end of script and css files and change it as I roll out updates? Or what is a general strategy here?
Thank you, Boda Cydo.
Yes, the way you mention is very common and is a solid approach.
I personally use the Subversion revision number of my files, but you could use anything meaningful to you, even the last updated timestamp of the file.
StackOverflow uses the SVN revision number:
<script type="text/javascript" src="http://sstatic.net/so/js/master.js?v=6180">
</script>
It turns out squid does not cache files with a GET parameter. You would have to use something like script.2010-02-14.js if you want squid to cache the file.
"But which is better: mylogo.1.2.gif or mylogo.gif?v=1.2? To gain the benefit of caching by popular proxies, avoid revving with a querystring and instead rev the filename itself."
http://webcache.googleusercontent.com/search?q=cache:JhDnwSNN-BEJ:www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/+http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/&cd=1&hl=en&ct=clnk&gl=us&client=opera&source=www.google.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With