Загрузка видео...

Не удалось загрузить видео

На главную

cacheComponents in Next.js (canary)

38,460 просмотров • 1 год назад •via X (Twitter)

Комментарии: 23

Фото профиля Alex Sidorenko
Alex Sidorenko1 год назад

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

Фото профиля Jon
Jon1 год назад

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

Фото профиля Alex Sidorenko
Alex Sidorenko1 год назад

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.

Фото профиля Jon
Jon1 год назад

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.

Фото профиля Leonardo Dominguez
Leonardo Dominguez1 год назад

is this a future successor to PPR?

Фото профиля Alex Sidorenko
Alex Sidorenko1 год назад

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

Фото профиля aymen bachiri
aymen bachiri1 год назад

👏

Фото профиля Big bro
Big bro1 год назад

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

Фото профиля Alex Sidorenko
Alex Sidorenko1 год назад

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

Фото профиля Tom Sherman
Tom Sherman1 год назад

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

Фото профиля Dale
Dale1 год назад

This seems like PPR

Фото профиля Zain
Zain1 год назад

I like your wallpaper. Can you share it?

Фото профиля Alex Sidorenko
Alex Sidorenko1 год назад

It's one of the backgrounds from @screenstudio

Фото профиля abir
abir1 год назад

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.

Фото профиля Dustin
Dustin1 год назад

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.

Фото профиля Abundance Ken-Dickson
Abundance Ken-Dickson1 год назад

Im curious: Are there any specific use cases?

Фото профиля Alex Sidorenko
Alex Sidorenko1 год назад

Demo from the video fixes this problem

Фото профиля Min Chon Chi
Min Chon Chi1 год назад

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

Фото профиля The Doctor
The Doctor1 год назад

Does this cache on the local development?

Фото профиля Mohit Nagaraj ☄️
Mohit Nagaraj ☄️1 год назад

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

Фото профиля Kajetan Szymczak
Kajetan Szymczak1 год назад

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

Фото профиля Alex Sidorenko
Alex Sidorenko1 год назад

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

Фото профиля Kajetan Szymczak
Kajetan Szymczak1 год назад

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

Похожие видео