NewsCrawler.org

Next.js 16 Cache Components: migrating from the four-layer cache model

宣言したものだけがキャッシュされる ── Next.js 16 Cache Components、4層モデルからの移行ガイド
Next.js 16 Cache Components: migrating from the four-layer cache model
Next.js 16 Cache Components: migrating from the four-layer cache model
Next.js 16 Cache Components: migrating from the four-layer cache model
Image: zenn.dev

The article is a follow-up to an earlier piece on the four cache layers of the App Router. It covers Cache Components[1], a feature introduced in Next.js 16. In version 16.4, released in October 2026, the Next.js team recommended it for all apps, and create-next-app enables it by default in new projects. Next.js 17 is expected to make it the default for the whole framework. Existing apps are not affected unless they set cacheComponents: true in next.config.ts.

With the setting enabled, nothing is cached by default, and only the places that are explicitly declared get cached. Route settings such as dynamic and revalidate cause build errors and cannot be combined with this model. Request Memoization stays the same, the role of the Data Cache[2] moves mainly to use cache, though existing fetch caches keep working, and the Full Route Cache is replaced by a static shell with PPR[3].

A developer has four decisions to make about caching: what to cache (use cache), where to store it (three variants, including remote for an external store such as Redis), how long to keep it (cacheLife), and how to update it (cacheTag with updateTag or revalidateTag).

Read the original zenn.dev

Sources

  • Zenn JA

    宣言したものだけがキャッシュされる ── Next.js 16 Cache Components、4層モデルからの移行ガイド

    3 likes0 bookmarks0 comments

Published: First seen: Читать по-русски

Open as a page