Rushdeep Singh Rushdeep Singh - 10 days ago 6
AngularJS Question

Implement a strategy for html5 angular views that once I change the view and deploy it, the browser should not use the cached version

Implement a strategy for html5 angularjs views that once I change the view and deploy it, the browser should not use the cached version.

I tried using the URL?v=1.0.1 idea but then it forces the app to load the html page every time from the server, the way I would prefer is that the browser caches the page on load and keeps using the cached version until a newer version is deployed, so some kind of cache breaker strategy for HTML pages. And I have tried many html cache breakers most of them do the same thing force load the HTML page each time, which is not ideal, my middle tier is ASP .NET WEB API and front end is AngularJS. Not sure if there is a server side setting I can do to achieve the result I intend to.

Answer

I accomplished this using HTML5 Manifest file :), and I use my build process to update the manifest file so that the browser is forced to get a fresh copy of the changed html files.

Comments