-
Notifications
You must be signed in to change notification settings - Fork 657
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
Returning cache expired data if there is no network #2502
Comments
Hi 👋 I'm afraid this is not possible using the Apollo APIs but maybe this can be done using the OkHttp cache. |
Thanks a lot for the quick answer @martinbonnin. I found a very old issue where there is a discussion that could be related to this topic. The issue was closed and the API has changed a lot in the last years, do you know if there are plans to implement something like
|
There are a lot of improvements we'd like to do to the cache that we're trying to keep track of there: #2331. Most of them are around the normalized cache at this point so it'll most likely come first. |
Do you think this change could be done to the HTTP cache? Is there a list of improvements for the HTTP cache? |
The above ticket is a mixed bag that lists everything cache-related (HTTP and normalized, memory and SQL, etc...). Changes to the HTTP cache can definitely be done but I have no idea when that could land. |
It should be there already :-). It's called |
Sorry I just saw it. We can close this issue then. Thanks!! |
Hi,
I want a query to be cached during 12h, after 12h I want it to make a request to the server. The issue is that I also need to be able to return the data when there is no connection and in some cases, the cache will be expired and will return an error.
This is my code:
I need to configure the cache in such a way that data is only requested to the server every 12h but cached data is returned if the user has no internet (even when 12h passed since the last successful request).
Is there a way to accomplish this? Can I configure the cache to don't remove the expired data (only setting a flag "expired" to it) so it can be reused?
Thanks!
The text was updated successfully, but these errors were encountered: