lvbreda / Meteor_angularjs

279 stars 42 forks source link

files in directives directory that are used as templates are cached by the browser even when autoreloaded #16

Open xiphias opened 11 years ago

xiphias commented 11 years ago

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.

xiphias commented 11 years ago

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'

lvbreda commented 11 years ago

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.

xiphias commented 11 years ago

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.