-
Notifications
You must be signed in to change notification settings - Fork 738
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
JSONRequest and HTTPRequest ignoring Apollo cachePolicy #3432
JSONRequest and HTTPRequest ignoring Apollo cachePolicy #3432
Comments
Here's the changes we made to map Apollo's cache policy to URLRequest's
|
Hi @PatrickDanino 👋🏻
Are you using the standard |
Hi, We do, but wouldn't you potentially have the same problem if you're using persisted queries? I thought that defaulted to a |
We have guidance on how to send APQ retries using |
I'll admit I'm not entirely clear on what is being suggested. Are you saying Separately, it's not clear to us why the default is to use |
Nothing has been suggested yet, I was trying to understand why we're seeing the standard iOS URL caching behaviour which we now know is because of
It is supported. We have documentation stating how to do that.
GraphQL uses
Then you should probably be trusting what the
This is the only unresolved issue since there is no way to opt-out of the default iOS URL caching behaviour. |
I'll take this to the rest of the team and see what we can do about it. |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better. |
The change for this has been merged and will go out in the next release. |
@PatrickDanino - I wanted to make you aware of a change coming related to this original issue, see apollographql/apollo-ios-dev#550. It shouldn't change the behaviour you originally enquired about (ignoring iOS cache data) but I'm posting here because the default cache policy behaviour will change. |
Appreciated! I’ve been tracking the other report. |
Summary
We were surprised to find out that despite setting a cache policy of
fetchIgnoringCacheCompletely
, we were still being returned cached data when making a query.We suspect the issue is with
JSONRequest
andHTTPRequest
. Neither appears to be using thecachePolicy
passed in as a parameter when generating theURLRequest
whentoURLRequest()
is called.By default, iOS can cache data using the
URLCache
and allows this to be configured using the request'scachePolicy
property (which is of typeURLRequest.CachePolicy
, not to be confused withApollo.CachePolicy
). Apollo should be setting the policy on theURLRequest
it is creating to an appropriate value based on its own request cache policy.Version
1.15
Steps to reproduce the behavior
cachePolicy
tofetchIgnoringCacheCompletely
Expected: The server should be hit every time
Current: The data may be cached by
URLCache
Logs
Anything else?
No response
The text was updated successfully, but these errors were encountered: