Next.js usage of revalidate in getStaticProps for cache #1276
Unanswered
mcunningham
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I am exploring using react-query in my latest project, everything is great so far! I have a quick question as I am using Next.js and would like to use SSG for some pages and then provide client side updates with the same key. I followed Next.js/SSR example on the React Query site https://react-query.tanstack.com/docs/guides/ssr, but I am a bit confused on how the revalidate flag comes into play here in regards to cache. Say for example I set
revalidate: 1
in getStaticProps, which triggers page re-generation every one second on the server, how would this be impacted if client side cache is also being updated for a query for the same key? If anyone has any examples/clarifications on how to use the revalidate flag with Next.js SSG and react-query it would be much appreciated!Beta Was this translation helpful? Give feedback.
All reactions