next-cache-components

Enable Partial Prerendering in Next.js 16 with Cache Components.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/SatohaCC/nextjs-mdx-blog --skill next-cache-components-satohacc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-cache-components
Source: https://github.com/SatohaCC/nextjs-mdx-blog/tree/main/.agents/skills/next-cache-components
Command: npx skills add https://github.com/SatohaCC/nextjs-mdx-blog --skill next-cache-components-satohacc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cache Components enable Partial Prerendering (PPR) - mix static, cached, and dynamic content in a single route.

Core Features & Use Cases

  • Three Content Types: Static (Auto-Prerendered), Cached (use cache), and Dynamic (Suspense)
  • Use cache directive with file, component, and function level scoping
  • Cache Profiles, cacheLife, cacheTag, updateTag, revalidateTag, and data constraints
  • Complete migration guidance from unstable_cache
  • Runtime data constraints and patterns for passing runtime values into cached parts

Quick Start

Use Cache Components in Next.js 16+ by enabling cacheComponents in next.config.ts and annotating code with 'use cache' where appropriate.

Frequently Asked Questions about next-cache-components

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable Partial Prerendering in Next.js 16?

Partial Prerendering in Next.js 16 is enabled by setting cacheComponents to true in next.config.ts and applying the 'use cache' directive to selectively cache route components and data-fetching scenarios.

What does the 'use cache' directive do in Next.js server components?

The 'use cache' directive in Next.js server components designates specific files, components, or functions as cached content, allowing you to mix static, cached, and dynamic content within a single route.

How do I migrate from unstable_cache to Cache Components in Next.js?

Migrating from unstable_cache to Cache Components involves replacing the old wrapper with the 'use cache' directive and configuring cache behavior using cacheLife, cacheTag, updateTag, and revalidateTag.

Can I pass dynamic runtime data into cached components in Next.js?

Yes, Cache Components support runtime data constraints and patterns, allowing you to securely pass dynamic runtime values into cached parts while maintaining proper selective cache invalidation behavior.

How does cache invalidation work with Next.js Cache Components?

Cache invalidation for Next.js Cache Components is managed by assigning cacheTag identifiers to cached data and triggering updates via the updateTag and revalidateTag functions when underlying data changes.