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
Is there a way to always do hard navigation to particular route segments to always re-render server components?
An RSC page does data fetching so when on a subsequent back/forward browser navigation we get back to the page it has stale data loaded via Client Router Cache.
I know we can do useEffect with router.refresh but it generated unnecessary rendering cycles with old then new data.
Would be great to mark some pages to always do full re-render (at least at the page level, layouts can stay).
We do the initial server-side data loading mostly to have smoother page load. If we can't resolve the RSC stale data problem we'll need to switch back to pure client-side fetches (with showing loading spinner we tried to avoid) as it would simplify our code.
We don't like the router.refresh solution.
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.
-
Summary
Is there a way to always do hard navigation to particular route segments to always re-render server components?
An RSC page does data fetching so when on a subsequent back/forward browser navigation we get back to the page it has stale data loaded via Client Router Cache.
I know we can do useEffect with router.refresh but it generated unnecessary rendering cycles with old then new data.
Would be great to mark some pages to always do full re-render (at least at the page level, layouts can stay).
We do the initial server-side data loading mostly to have smoother page load. If we can't resolve the RSC stale data problem we'll need to switch back to pure client-side fetches (with showing loading spinner we tried to avoid) as it would simplify our code.
We don't like the router.refresh solution.
Additional information
We are using the latest 15.4 canary version.
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions