Replies: 4 comments 5 replies
-
Try adding dynamic = 'force-static' to your layout to see if it helps prevent the re-fetching on every navigation |
Beta Was this translation helpful? Give feedback.
-
Yes, but how to implement it depends on the type of app you are building and your goals. Pages that don't rely on dynamic data fetched in server components can be pre-built statically and will get prefetched by the For pages that do fetch dynamic data in server components, you can add Additionally, you can set https://nextjs.org/docs/app/api-reference/components/link#prefetch |
Beta Was this translation helpful? Give feedback.
-
It was possible in next js 15.1 using staleTimes, but 15.2 broke it. |
Beta Was this translation helpful? Give feedback.
-
Pretty sure in many cases it would make more sense to bundle the pages and load them at once. Excessive amount of small requests is both a waste and possibly a cost factor as well. Same thing with prefetching. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I just updated an app from NextJS 14 -> 15 and noticed that every time we navigate through the app, a new
?rsc
call is being made.This even happens when navigating to sub-pages of the same layout (imagine a layout with tabs and children pages underneath).
Screen.Recording.2025-03-23.at.12.40.54.mov
I tracked this behavior to this update: https://nextjs.org/blog/next-15#client-router-cache-no-longer-caches-page-components-by-default
For the type of app we're building this is quite a big annoyance. We want the app to be super snappy and fast when moving around, but now you have all those delays.
My question is: Is it possible to have instant SPA-like navigations?
I saw they mention the
staleTimes
config in that blog post, but on it's own individual page I see:How is everyone getting around this problem?
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions