Invalidate React Query on SSR Next JS (App Router)
I am using SSR React Query by following this guide - https://tanstack.com/query/latest/docs/framework/react/guides/advanced-ssr
I have a API that fetches me list of products.
I am using SSR react query to cache the response
my common queryClient file
and page where I am fetching the products
But my main issue is, when the Backend Data change, It takes upto 10 mins to update the data on frontend to validate it.
How can I clear the cache on server side from backend?
I tried create a api route in nextjs and create a POST API
But this doesn't work either.
The I replaced my getQueryClient Function with this as well
which didn't helped either.
Please suggest something that would help me, or would I need to remove the SSR from frontend?
Advanced Server Rendering | TanStack Query React Docs
Welcome to the Advanced Server Rendering guide, where you will learn all about using React Query with streaming, Server Components and the Next.js app router. You might want to read the before this on...
0 Replies