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•4d ago
sounds like you don't recreate the query client per request
harsh-harlequinOP•4d ago
Yea , I found it