T
TanStack4mo ago
fascinating-indigo

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
statutory-emerald
statutory-emerald4mo ago
sounds like you don't recreate the query client per request
fascinating-indigo
fascinating-indigoOP4mo ago
Yea , I found it

Did you find this page helpful?