0

My boss complaints that when I create a new version of our site, the users need to press Ctrl+F5 in order to make the site functional again. This seems to be a JavaScript issue (appearing when I modify JavaScript).

What to do? I don't want users to press Ctrl+F5 neither to understand what the F5 key does.

porton
  • 5,214
  • 11
  • 47
  • 95
  • well, it's an problem with the cache then... mayby you can search for een cache flush for javascript?!? – Mathlight Sep 19 '12 at 13:03
  • This is the answer: [http://stackoverflow.com/a/1011617/1175881][1] [1]: http://stackoverflow.com/a/1011617/1175881 – Mathlight Sep 19 '12 at 13:04

1 Answers1

4

Add a versioning flag to your script includes

<script src="myScript.js?v=2"></script>

That way you can update the version code whenever your script has changed, and you don't want to load the file from the user's cache.

If you're using any serverside language, instead of a version-number, you could have a hash of the file's content, so that it'd automatically update whenever the file changes.

David Hedlund
  • 128,221
  • 31
  • 203
  • 222