By adding updates to javascript and css I want to avoid to force users to press Ctrl+F5 to refresh cached js and css files.
Disabling cache is not a choise too.
For this I suppose to add version to js and css links like this
< link href="~/CSS/file.css?MY_VERSION" rel="stylesheet" />
Ideally version has to be something like build number of build date and time.
But how can I set this automatically?
I do not want to update this values at all jsp files manually after every update. So questions are
- can maven add build version to jsp files?
- if first point is not possible how (and where) can I set application global variable with current date and time? For example I cannot put it into servlet because it is constructed with every request.
- What are best practices for do this? Maybe my approach is totally incorrect