T
TanStack4mo ago
underlying-yellow

Invalidate QueryClient server cache

I’m using TanStack Query inside TanStack Start, and I’ve set the staleTime to 5 minutes. When I perform a mutation, I invalidate the related queries, which works fine on the client side. However, when I reload the page, the server still serves the old cached query data. This causes outdated information to be shown, even though the client cache has been correctly updated.
2 Replies
sunny-green
sunny-green4mo ago
sounds like you don't recreate the query client per request
underlying-yellow
underlying-yellowOP4mo ago
Yea , I found it

Did you find this page helpful?