-
Hi, dear react-query community! I have been using react-query for some time now, and it seems to fix a lot of issues out of the box which is really cool. I have been using react-query in React projects only however, I am now trying to integrate it into a Next.js app. I am particularly interested in the "Using Hydration" feature, where However, as already mentioned in docs,
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
I haven't tried that yet, but what you are looking for sounds like the
not sure how redis would handle concurrent writes, but I guess it can? let me know how it works :) |
Beta Was this translation helpful? Give feedback.
I haven't tried that yet, but what you are looking for sounds like the
persistQueryClient
plugin. I would go to v4 for this, as we've improved the api: https://react-query-beta.tanstack.com/plugins/persistQueryClientgetServerSideProps
:await persistQueryClientRestore
to load from the external storageawait prefetchQuery
as per usual, but pass astaleTime
to it, so that you'll read data from the cache if its not older than the passed timeawait persistQueryClientSave