AngularJS Firefox HTML Cache

It is very annoying to develop in Firefox as part of AngularJS. What for? Because you are just updating and JavaScript is reloading, but this is not the case for HTML many times. Therefore, every time you change one bit in the template, you need to manually clear the cache to make sure that the changes are applied.

Any idea on why Firefox / Angular does this and how to prevent it?

I also tried the Hard Refresh extension ( https://addons.mozilla.org/en-US/firefox/addon/hard-refresh/?src=search ) to simplify the task, as well as the combination of Ctrl + F5, but even this is not enough to really refresh the page. The only way I've found so far is the settings menu on the privacy tab, selecting (only) the cache that you want to clear.

+2
source share
2 answers

Both Firefox devtools and Firebug have the ability to temporarily disable caching.

If you use a full-featured web server for development, you can disable the cache from the server side, so you are not limited to the debugger panel.

+2
source

You tried to use $ templateCache to clear it, in the app.run function add the following code:

$rootScope.$on('$viewContentLoaded', function() { $templateCache.removeAll(); }); 
0
source

Source: https://habr.com/ru/post/1015664/


All Articles