Replies: 2 comments
-
Anyone? 🙏 |
Beta Was this translation helpful? Give feedback.
0 replies
-
That would be great! Bumping it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm using a solution similar to this to persist query cache to indexeddb: #1638 (comment)
Now the problem is that it stores the whole cache in a single entry and rehydrates it all at once.
What I would rather have is that each query key would be a dedicated entry in persisted cache and that it would be restored lazily on first query call, not all at once.
Is there a way to achieve smth like this with current API or should I go back to managing this persistance logic outside of react-query?
Basically I want in-memory query cache to be like an L1 cache and indexed db to be like an L2 cache. Key not in L1? Check L2. Not in L2? Do the query.
For context: my app is a calendar app where you have a ton of information for each day. It pre-caches things for offline use 30 days ahead. It could add up to quite a bit of data, and trying to restore it in one gulp becomes problematic and unreasonable.
Beta Was this translation helpful? Give feedback.
All reactions