-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add Expiration / TTL to InMemoryCache #336
Comments
@Sumu-Ning Thanks for reporting this, we'll consider it and keep this FR open for others in the community to share their thoughts. I also added some product considerations we'd be making in implementing something such as this. |
Has there been any progress on adding TTL configuration for apollo client cache? It would be nice to have this fine grained control over cache expiration. Thanks! |
@torressam333 no updates to share at the moment 🙂. We are aware of the growing popularity of this request but we haven't yet prioritized it on our roadmap. We'll update this request when we know more. |
@jerelmiller Sounds good. Is the recommended approach for custom cache management to use eviction/gc for the time being? https://www.apollographql.com/docs/react/caching/garbage-collection Thanks! |
@torressam333 yep that should work for you 🙂 |
We are using ApolloClient + InMemoryCache to do some GraphQL queries. However, our backend data is not immutable, and therefore, we might need to get the fresh data every some time. It looks like the current InMemoryCache does not have a way to set the TTL to cached data, and the data will stay there for a long time, if not kicked out by size limit.
I would like to suggest to add a feature in InMemoryCache to limit the Time-to-live in InMemoryCache, which can be implemented in either an eager or lazy way.
Product Questions to consider
Is the TTL client or server controlled?
Would we apply this to all 3 clients?
The text was updated successfully, but these errors were encountered: