next-cache-components

Configure Next.js Cache Components for static, cached, and streaming rendering.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/irchamaji/agents --skill next-cache-components-irchamaji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-cache-components
Source: https://github.com/irchamaji/agents/tree/main/skills/next-cache-components
Command: npx skills add https://github.com/irchamaji/agents --skill next-cache-components-irchamaji

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you configure Next.js 16+ Cache Components so you can combine partial prerendering (PPR) with predictable caching, without relying on deprecated experimental flags.

Core Features & Use Cases

  • Cache Components Configuration: Enable cacheComponents in next.config.ts to replace the older experimental.ppr workflow.
  • Three Rendering Modes in One Route: Use static auto-prerendering, async cached data with the use cache directive, and dynamic streaming via Suspense.
  • Cache Controls: Apply cacheLife for lifetimes, cacheTag for tagged invalidation, and updateTag/revalidateTag for immediate vs background refresh behavior.
  • Runtime Data Constraints: Enforce the rule that cookies/headers/searchParams can’t be accessed inside use cache unless you intentionally use use cache: private.

Quick Start

In your Next.js project, enable cacheComponents in next.config.ts and refactor your async components to use the use cache directive with cacheLife or cacheTag as needed for your data.

Frequently Asked Questions about next-cache-components

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

FAQPage Schema
How do I configure Next.js Cache Components to mix static and dynamic content?

Next.js Cache Components allow you to mix static auto-prerendering, async cached data using the use cache directive, and dynamic streaming via Suspense boundaries all within a single route.

How do I migrate from experimental PPR to Next.js Cache Components?

Migrate from experimental PPR by enabling cacheComponents in next.config.ts to replace the deprecated experimental.ppr workflow, refactoring async components to use the use cache directive with appropriate cache controls.

When should I use cacheTag vs updateTag or revalidateTag for cache invalidation?

Use cacheTag to label cached data for targeted invalidation, then apply updateTag for immediate refresh behavior or revalidateTag for background refresh to control data staleness.

Why does accessing cookies or headers break the use cache directive in Next.js?

Accessing cookies, headers, or searchParams inside use cache breaks caching because dynamic runtime data cannot be cached unless you explicitly refactor to use use cache: private.

Does Next.js Cache Components require replacing the experimental PPR flag?

Yes, Next.js Cache Components requires replacing the deprecated experimental.ppr flag by enabling cacheComponents: true in next.config.ts to achieve predictable partial prerendering behavior.