T
TanStack6h ago
ratty-blush

Dev mode cache logic question

When running dev, I have to re-fetch all of my collections each time i refresh the page. I'm sure I'm ignorant here, but shouldn't it persist the data across refreshes and update it being local first? Or is this by design in dev mode?
1 Reply
eastern-cyan
eastern-cyan5h ago
are you talking about tanstack db in this case? both query and db stores the cache in memory by default. and refreshes clean the memory if you want to persist data across refreshes, you need to set up persister separately https://tanstack.com/query/latest/docs/framework/react/plugins/persistQueryClient
persistQueryClient | TanStack Query React Docs
This is set of utilities for interacting with "persisters" which save your queryClient for later use. Different persisters can be used to store your client and cache to many different storage layers....

Did you find this page helpful?