You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing code as shown above, accessing the Page always triggers the server to execute prefetch, which then waits for the duration specified by the delay time in the API fetch function.
What I expected was that after the initial prefetch, when leaving and re-entering the page, it wouldn't re-fetch because it uses react-query's cached data. Is this an unavoidable behavior because RSC always renders anew in an SSR environment?
My knowledge is quite limited, so I may have written the code incorrectly. I need help with this.
Thank you to everyone who took the time to read this long post.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, while testing data fetching using
prefetchQuery
andHydrationBoundary
in a Next.js environment, I encountered a question.First, I am attaching the source code for the environment I am testing.
When writing code as shown above, accessing the Page always triggers the server to execute prefetch, which then waits for the duration specified by the delay time in the API fetch function.
What I expected was that after the initial prefetch, when leaving and re-entering the page, it wouldn't re-fetch because it uses react-query's cached data. Is this an unavoidable behavior because RSC always renders anew in an SSR environment?
My knowledge is quite limited, so I may have written the code incorrectly. I need help with this.
Thank you to everyone who took the time to read this long post.
Beta Was this translation helpful? Give feedback.
All reactions