next-cache-components

Enable Partial Prerendering with cacheComponents and use cache in Next.js 16.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Next.js route rendering often forces either static rendering or full dynamic rendering, leading to slow pages or stale data. Cache Components solves this by enabling Partial Prerendering to mix static, cached, and dynamic content in a single route.

Core Features & Use Cases

  • Enable cache components in Next.js 16 to replace experimental flags with cacheComponents: true and the use cache directive for selective caching.
  • Support three content types: Static (auto-prerendered), Cached (use cache with cacheLife), and Dynamic (Suspense) for live data.
  • Provide cache lifecycle controls such as cacheLife, cacheTag, and updateTag to fine-tune data freshness and invalidation in production.

Quick Start

Enable cache components in next.config.ts by setting cacheComponents: true and restart the server to see partial prerendering in action.

Frequently Asked Questions about next-cache-components

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

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

Cache Components in Next.js enable Partial Prerendering by combining static prerendered segments, cached segments using 'use cache', and dynamic parts wrapped in Suspense within a single route.

What is the best way to enable Cache Components in Next.js 16?

To enable Cache Components in Next.js 16, set cacheComponents: true in your next.config.ts file and restart the server to activate Partial Prerendering and selective caching.

How do Cache Components handle data freshness and invalidation?

Cache Components handle data freshness using cache lifecycle controls like cacheLife to define duration, cacheTag for labeling, and updateTag for manual revalidation of cached segments.

Does my Next.js project need specific configurations for Partial Prerendering?

Yes, Next.js projects require setting cacheComponents: true in next.config.ts to replace older experimental flags and enable deterministic caching for static and cached route segments.

Can I control caching for specific resources like scripts and assets in Next.js routes?

Yes, Cache Components support optional resources in scripts, references, and assets, allowing you to apply deterministic caching controls across routes and layouts in Next.js 16.