Replies: 2 comments 2 replies
-
if you reload the browser, the cache is gone because the cache lives in-memory. If you want a persistent cache, you can try out the (experimental) persistQueryClient plugin: https://react-query.tanstack.com/plugins/persistQueryClient |
Beta Was this translation helpful? Give feedback.
1 reply
-
@TkDodo if I may ask, why this plugin is not avaiable anymore on v5? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to set a 24 hours cache once a useQuery request has succeeded.
But as soon as I refresh the page, the cache is gone. I see it because I console.log a message each time the route is hit on my server.
How to prevent this behaviour and implement a real cache?
Here is the code:
I've also tried to replace cacheTime by staleTime.
Beta Was this translation helpful? Give feedback.
All reactions