After deploying our AngularJS / Symfony2 application we found our users browsers loading cached assets from the previous deployment. The user would have to empty the cache / perform a hard refresh before the new version of the assets would be loaded. This behavior occurs because the url to the updated resources do not change during deployment.
To do this we used grunt-replace to replace a placeholder value (
@@TIMESTAMP@@) in the html file with a timestamp during the build of our frontend assets.
The snippet from
index.html where the assets are loaded would look something like the following snippet: