What is the point of maxAge
in PersistQueryClientProvider
?
#5169
-
Hi! I've started using
yet React Query allows us to declare any
and we instantiated our
with a query that we're enabling dehydration on as:
If we decrease If we increase So the question is: Shouldn't It seem error prone to define a Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi 👋 This is explained to some degree here: https://tanstack.com/query/v4/docs/react/plugins/persistQueryClient#how-it-works
To answer your question:
I think it should be seven days. Queries should have a cache time that is equal to or greater than the persisted cache's max-age. If this isn't the case, the persisted cache will be discarded before the query becomes stale. The cache shouldn't live longer than the time that the query is considered fresh. Hopefully this helps 🙂 |
Beta Was this translation helpful? Give feedback.
-
I don't think the question was answered regarding the purpose of Let's say I have |
Beta Was this translation helpful? Give feedback.
Hi 👋
This is explained to some degree here: https://tanstack.com/query/v4/docs/react/plugins/persistQueryClient#how-it-works