Cache not Working #1518
Unanswered
rajatdhoot123
asked this question in
Q&A
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
const queryClient = new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false, staleTime: Infinity } } });
Here are my query client and prefetching query using getServerSideProps and the query keys are the same then also it will calling API call on-page navigation because getServerSideProps get called again.
My assumption is it will not make API calls as the query key is the same and stateTime is Infinity.
Can you please suggest how to not make API calls if data is already present?
Beta Was this translation helpful? Give feedback.
All reactions