Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

cacheComponents in Next.js (canary)

38,460 Aufrufe • vor 1 Jahr •via X (Twitter)

23 Kommentare

Profilbild von Alex Sidorenko
Alex Sidorenkovor 1 Jahr

There is more to cacheComponents, of course. I will create a few more vids But it seems to fix the accidental dynamic rendering problem which is huge. Rendering strategy and caching gets much more explicit

Profilbild von Jon
Jonvor 1 Jahr

Have you checked this out yet? The cacheComponents thing isn’t working when deploying to Vercel. Locally (build/start) it works fine though.

Profilbild von Alex Sidorenko
Alex Sidorenkovor 1 Jahr

Nope, thanks for the link. It's still experimental and in canary, I wouldn't use it in prod rn Can't wait for the stable release. It is a huge and much-needed shift towards explicit caching and rendering.

Profilbild von Jon
Jonvor 1 Jahr

I can’t wait either. It’s been experimental for way too long. Once this is stable it’ll make Next.js great again. Just fix it already.

Profilbild von Leonardo Dominguez
Leonardo Dominguezvor 1 Jahr

is this a future successor to PPR?

Profilbild von Alex Sidorenko
Alex Sidorenkovor 1 Jahr

Yep, it combines ppr, dynamic IO, and "use cache" into one flag

Profilbild von aymen bachiri
aymen bachirivor 1 Jahr

👏

Profilbild von Big bro
Big brovor 1 Jahr

im so <Awaited /> pilled at this point for some reason yet still miss nextjs😭

Profilbild von Alex Sidorenko
Alex Sidorenkovor 1 Jahr

It feels like cacheComponents fixes the most fundamental problem of the app router. But hard to tell until the stable release

Profilbild von Tom Sherman
Tom Shermanvor 1 Jahr

If they can figure out skipping those cached components in SSR then it could save billions of dollars in compute

Profilbild von Dale
Dalevor 1 Jahr

This seems like PPR

Profilbild von Zain
Zainvor 1 Jahr

I like your wallpaper. Can you share it?

Profilbild von Alex Sidorenko
Alex Sidorenkovor 1 Jahr

It's one of the backgrounds from @screenstudio

Profilbild von abir
abirvor 1 Jahr

Unfortunately my biggest reason for using server components, was to get rid of as much loading state as possible. Not worth it to introduce this caching if it means users now have to see loading states.

Profilbild von Dustin
Dustinvor 1 Jahr

This new feature looks promising for improving performance and developer experience. Can't wait to see how it evolves and impacts future Next.js projects.

Profilbild von Abundance Ken-Dickson
Abundance Ken-Dicksonvor 1 Jahr

Im curious: Are there any specific use cases?

Profilbild von Alex Sidorenko
Alex Sidorenkovor 1 Jahr

Demo from the video fixes this problem

Profilbild von Min Chon Chi
Min Chon Chivor 1 Jahr

Looking forward to seeing the final version of cacheComponents in Next.js.

Profilbild von The Doctor
The Doctorvor 1 Jahr

Does this cache on the local development?

Profilbild von Mohit Nagaraj ☄️
Mohit Nagaraj ☄️vor 1 Jahr

cacheComponents in Next.js canary looks like a solid performance boost for frequently accessed UI elements- definitely worth exploring for optimizing render times and reducing server load

Profilbild von Kajetan Szymczak
Kajetan Szymczakvor 1 Jahr

Do I need to explicitly cache calls such as 'getUser' to cache them between multiple server components?

Profilbild von Alex Sidorenko
Alex Sidorenkovor 1 Jahr

If you mean memoization (to avoid triggering a function multiple times during a single request), then yes. However, it works more like deduping than a persistent cache The name of this function causes a lot of confusion

Profilbild von Kajetan Szymczak
Kajetan Szymczakvor 1 Jahr

Yes, I meant that cache (which is memoization) from react ;) So it looks very similar to ppr but without "ppr" flag

Ähnliche Videos