I deploy my project by building source files with gulp right on the server. To prevent caching issues, the best practice could be adding a unique number to request url, see: Preventing browser caching on web application upgrades;
In npm repositories, I couldn't find a tool for automatically adding version number to request. I'm asking if someone has invented such tool before.
Possible implementation could be the following:
I have a file index.html in src/
folder, with following script tag
<script src="js/app.js<!-- %nocache% -->"></script>
During build it is copied to dist/
folder, and comment is replaced by autoincrement number
<script src="js/app.js?t=1234"></script>
See Question&Answers more detail:os