How to make sure a cached JavaScript and CSS files get reloaded?

caching

Solution

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> 

Problem

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.

Original source