Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$http cache doesn't work for JSONP requests #1947

Closed
tcoopman opened this issue Feb 4, 2013 · 7 comments
Closed

$http cache doesn't work for JSONP requests #1947

tcoopman opened this issue Feb 4, 2013 · 7 comments

Comments

@tcoopman
Copy link

tcoopman commented Feb 4, 2013

Using the $http with cache doesn't work for JSONP methods. At the moment the cache only works for GET methods, while I think it could be useful to cache JSONP too if the the cache-control headers allow it.

Are there reasons JSONP can't be cached? I think the callback could be a small issue?

After some more research I've found this discussion on the mailinglist and merge request that is looks like it could solve this issue. At the moment the merge request is closed though.

@jendib
Copy link

jendib commented Apr 23, 2013

I have the same question here, why JSONP is not cached?
It's not a technical problem, because if we comment out the part checking if it's a GET request, JSONP caching works.

@iamjohnlong
Copy link

I was wondering the same.

@Guuz
Copy link

Guuz commented Aug 5, 2013

👍

@steveruiz
Copy link

It looks like the problem has to do with the way URL's are constructed for JSONP requests. Angular replaces the JSON_CALLBACK parameter value on each request so the URL is unique each time. This URL mismatch causes the cache to miss.

@cironunes
Copy link
Member

this one is related #3073

@jeffbcross jeffbcross added this to the 1.3.x milestone Mar 6, 2014
@maxbates
Copy link

+1

@mrpollo
Copy link

mrpollo commented Jul 29, 2014

👍 great catch

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

Successfully merging a pull request may close this issue.

9 participants