Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE 8-9 cache fix makes etag caching not working at all #324

Open
svlapin opened this issue Sep 19, 2016 · 0 comments
Open

IE 8-9 cache fix makes etag caching not working at all #324

svlapin opened this issue Sep 19, 2016 · 0 comments

Comments

@svlapin
Copy link

svlapin commented Sep 19, 2016

Hey guys,

first of all, thanks for the wonderful module!

Found that our app never GETs 304 for subsequent requests when it should to.
After some investigations I found that the reason is https://github.com/lynndylanhurley/ng-token-auth/blob/master/src/ng-token-auth.coffee#L920 which sets If-Modified-Since header to Mon, 26 Jul 1997 05:00:00 GMT $http-widely. This makes browser not to set If-none-match header even if the previous response to the same resource had etag header provided (tested in Chrome 55, Firefox 48).

As we don't support IE8-9, I just fixed the issue by resetting

$httpProvider.defaults.headers.get = {};

From the more common point of view, don't you think it would be better if ng-token-auth set such If-Modified-Since header on per-request basis?
I'm not very familiar with coffeescript, but think I'll be able to come up with PR if you agree.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant