One fairly common solution (which is also used here in SO, I think) is to add a query string to the url of the javascript file containing the version number. When you change the query string, the browser will process it as a new file and load, and not select from the cache.
<script type="text/javascript" src="http://example.com/file.js?v=2"></script>
In the above example, changing file.js?v=2to file.js?v=3will force the browser to download the file, rather than loading the cached ones file.js?v=2.
source
share