files in directives directory that are used as templates are cached by the browser even when autoreloaded
Opened this issue · 3 comments
I'm using html files in the partials/directives directory as html templates.
When I change a file, the application reloaded, but the browser caches the template, so a refresh itself doesn't help either, only clearing the browser cache.
It looks like the problem is that AngularJS doesn't send if-modified-since and if-none-match headers to the server.
A quick fix is to disable caching for templates:
Put this in app.js configuration (after injecting $httpProvider service)
$httpProvider.defaults.headers.common['Cache-Control']='no-cache'
Thank you @xiphias I will keep this issue open so other people can see your solution. I will try to do something neat in the package itself to make sure it works.
Actually I think this is a missing feature from AngularJS...I looked at the XMLHTTPRequest implementation and they don't support caching. JQuery library has the extra logic for it, so we should probably file a bug for AngularJS guys.