-
Notifications
You must be signed in to change notification settings - Fork 119
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
Cache expiration question #53
Comments
Hi @padupuy — Unfortunately, that's not possible today. Supporting per-key metadata (including a TTL/expiration time) is on the roadmap for the next major release, but it's unlikely to become available prior to then, due to the significant API changes it would require. #2 has a broader conversation around cache filtering/expiration, and I expect we'll continue the conversation over there once it's time to implement this feature. Until then, I'd suggest you stick with |
@jamesreggio thank you for your kind answer and your suggestion I already use |
You're welcome! Not sure about the next major version, but not anytime soon. |
Hi @jamesreggio, I wanted to check if this is still on the roadmap? Thanks. |
@wtrocki Happy to contribute. Are there any specific guidelines for this repo? |
Cache expiration is actually one of the main features of the Apollo Client 3.0. |
Hi @jamesreggio, I was hoping to find out if there were any updates regarding TTL/expiration times? |
@hwhh is this question in relation to Apollo 3.0. Generally TTL are handled on cache level. |
Hi @wtrocki, Thanks for getting back to me, yes this question in relation to Apollo 3.0; I opened an issue here apollographql/apollo-client#6484 (comment) but saw this issue too. I am not sure if it is possible, but (at least when using react-native) when items are persisted in the background, would it also be possible to remove expired items in the background as well? |
quick hotfix for me to invalidate cache regularly:
ok, this doesn't work because apparently nothing is returned? Seems odd to not return the object the cache is based on. gonna need to monkey patch it. |
Hi folks, I use
apollo-cache-persist
on a mobile app and I'm looking for a solution to get data if it exists, from the cache, else get it from remote.I am aware of apollo cache policy but the
cache-first
value is not really a good solution for me.I have a simple product list, when I click on a row, the detail screen is displayed and a product request is fired, so the request result is stored is the cache.
Then, I go back to the detail list.
Imagine 5mn later, I update my back office to change the product price.
If i go back to my detail screen, the product data will never be updated if I use the
cache-first
policy and will be always updated if I use thecache-and-network
policyIs there a way to add a cache expiration, maybe in minutes or hours ?
The text was updated successfully, but these errors were encountered: