"Navigation feels slow in Next.js"
@asidorenko_35.232 Follower
270.314 Aufrufe
51 Kommentare
Kommentare aus dem Originalbeitrag auf X (Twitter)

@asidorenko_
My previous suggestion was to use loading.tsx, but with cacheComponents enabled, the actual part of your page outside of Suspense boundaries acts like loading.tsx (static, prefetched) I'm not sure if you need loading.tsx with cacheComponents at all
49 Likes

@azamuddin91
Why another trick? Should it be default without developer thinking about yet another trick?
28 Likes

@azamuddin91
Hmmm, I assume there might be gotchas since they don’t want to implement thisas default right away. Perhaps they’ve learnt from the default cache change in around v13 to v14 then revert in v15 What nextjs has become, don’t get me wrong, I still use Nextjs to this date but
1 Like

@vladsazonau
imo this is how it should've worked from the beginning with server components 😌
21 Likes

@asidorenko_
@vlad_sazon Yep, implicitly static-by-default was not the best strategy for the app router. But I'd imagine it was tough to predict this for such a novel model as RSC Whoever paves the road for new technology pays the R&D price
9 Likes

@vladsazonau
Yeah, make sense 🙏
1 Like

@muizahg
Why not make it fast by default?
6 Likes

@mrgnou
It doesn't work with dynamic routes so far :/
5 Likes

@kevin_moechel
The video is kinda misleading. I can achieve the exact same in Next 15. That's just RSC. The point of the cache is that on subsequent navigations there's no loading state. This wasn't shown in the video
4 Likes

@asidorenko_
It was shown in the video. That's why you don't have lag during navigation on a dynamic page. You can only achieve this in Next 15 with PPR enabled. PPR is now part of cachedComponents model But the main point is that it's impossible to create a blocking route (it errors)

@kevin_moechel
Everything displayed in your video is easily done in Next 15, except the error when not using Suspense. The actual difference is that the Shell of the page is now served by the Vercel CDN which isn't the case in Next 15.

@asidorenko_
"except" and "the actual difference" from your response is exactly the point of the video

@iandavidandrino
It felt slow locally, until I upgraded to nextjs 16 and upgraded to stable react-compiler 🤯 Now it navigates before I even blink
3 Likes

@matt_teeixeira
This only for Next 16?
3 Likes

@asidorenko_
@Matt_TeixeiraBR Yep
3 Likes

@petsonii
damn this is something new for me gonna try it out, thank you 🙌🏼
2 Likes

@CodeHagen
Need to try, great one ✨
2 Likes

@quick007YT
how does this actually improve performance? does it just give a warning when you forgot to use suspense or does it do more under the hood?
2 Likes

@asidorenko_
It pre-generates everything outside Suspense as a static shell during the build time. This shell is prefetched by Links, so navigation is always fast. This was called partial pre-rendering before. Now it's a part of the cacheComponents model.
5 Likes

@quick007YT
makes sense! I'm familiar with PPR so hopefully cache components will fit into that mental model.
1 Like





















