We have an issue, which I'm sure is commonplace, whereby after deploying our web application, some users experience problems resulting from not having the latest versions of CSS or Javascript files. As developers, we simply hit CTRL + F5
and the problems go away as our browsers download the latest version of the page and associated scripts and stylesheets. However, it's not really practical to expect our users to do this after every deployment.
I'm aware of the method of forcing browsers to download the latest versions of files by appending a query string to the references to those files, which sounds like it would work perfectly well, but I'm trying to work out how to implement this technique with the smallest overhead for our devs.
Ideally, I think what we need is some sort of automated process which can detect when changes to a .js or .css file are checked in to source control (we're using VSTS) and update any links to that file in the application. We're using require.js for dependency injection, so perhaps that would make things easier, but I still don't know how to implement this.
At present, the only solution I can think of is to instruct our devs, every time they modify a .js or .css file, to search the code for any references to that file and manually add a version number query string in each place. And then hope that they remember to do this.
Is there a better way?