正在加载视频...

视频加载失败

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

相关视频