Skip to content
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

RFC: Root Query TTL #1480

Closed
thebigredgeek opened this issue Mar 23, 2017 · 4 comments
Closed

RFC: Root Query TTL #1480

thebigredgeek opened this issue Mar 23, 2017 · 4 comments

Comments

@thebigredgeek
Copy link
Contributor

thebigredgeek commented Mar 23, 2017

Hey guys,
I was thinking that perhaps a decent solution for the "ever expanding cache" problem might be to allow for a configurable TTL on root queries. This TTL value could reset whenever the query is updated. Whenever the query goes stagnant beyond a certain period, it could simply be purged out of the store once it's subscriber count reaches zero. Any store entries that are orphaned (you can no longer traverse references from the entry to a root query) would also be purged. Thoughts?

@stubailo
Copy link
Contributor

Sounds like: #41

I think this would be really cool to have after 1.0, we probably don't want to do it before then because it will require some store changes. But we could start working on designs now!

@thebigredgeek
Copy link
Contributor Author

Yeah agreed. I think we should take #1432 into account when talking about this, though, as there would likely need to be some sort of function on the storage interface that apollo-client would call to trigger the removal of a root query and orphaned entry cleanup

@kouak
Copy link

kouak commented Mar 26, 2017

My use case involves a complex SPA, running full screen for long periods of time (multiple days).

To prevent the store from ballooning, I've implemented a simple renderless component which will call client.resetStore() every now and then.

Ugly, but it does the job : https://gist.github.com/kouak/18910729ecfda906eadbd6084793f5eb

@cesarsolorzano
Copy link
Contributor

I'm closing this, please refer to #621 for updates on this topic

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants