How to update javascript file in client browser? -


When I have a bug in the javascript file, then I fix it and deploy it. But to keep updated files in the browser, I should press Ctrl + F5.

This is not a problem for me, but it is difficult to tell the user to update the file.

How to create a user browser to update the javascript file from the server without special actions?

The file is one of the paths to modify JS file - each time the file path will be different. But it is not convenient.

Many sites add URL parameters pointing to URLs Javascript file and each time the file changes It transforms it.

Something like this:

  & lt; Script langauge = "javascript" src = "myfile.js? Ver = 1" />   

And after a change:

   This can not be convenient, but this is the most common solution that some web infrastructure automates this process so that the developer has to increase the version number manually.   

Comments