cache-components

Enforce Next.js Cache Components patterns with caching primitives and Suspense usage.

1|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/hbvg234/jnmt.vn --skill cache-components-hbvg234
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cache-components
Source: https://github.com/hbvg234/jnmt.vn/tree/main/.claude/skills/cache-components
Command: npx skills add https://github.com/hbvg234/jnmt.vn --skill cache-components-hbvg234

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides expert guidance for applying and automating Next.js Cache Components and Partial Prerendering (PPR) patterns, helping teams optimize performance and maintain correctness across data fetching, caching, and rendering.

Core Features & Use Cases

  • Proactive activation in projects with cacheComponents: true to enforce caching best practices across React Server Components and server actions.
  • Comprehensive caching primitives: use cache, cacheLife(), cacheTag(), updateTag(), and revalidateTag() to optimize static shells, cached data, and dynamic streams.
  • Build-time feedback and safety: detects misconfigurations and provides actionable guidance for debugging and safe rendering with Suspense boundaries.

Quick Start

Enable this skill in a Next.js project and implement the core APIs (use cache, cacheLife, cacheTag, updateTag, revalidateTag) to begin leveraging Partial Prerendering with Cache Components.

Frequently Asked Questions about cache-components

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

FAQPage Schema
How do I use Next.js Cache Components for Partial Prerendering?

Next.js Cache Components apply 'use cache', cacheLife(), and cacheTag() to static shells and dynamic streams, ensuring correct co-location of cache logic within React Server Components for Partial Prerendering.

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

The 'use cache' directive caches server component output, working with cacheLife() to control duration and cacheTag() to enable targeted invalidation via revalidateTag() or updateTag() for dynamic content.

Do I need to enable cacheComponents in my Next.js config to use 'use cache'?

Yes, projects must enable cacheComponents: true in the configuration. The skill proactively detects this setting to enforce caching best practices across data fetching and server actions.

How do I invalidate cached data using cacheTag and revalidateTag in Next.js?

Assign cacheTag() to cached data boundaries, then call revalidateTag() or updateTag() in server actions to invalidate specific cached segments and refresh dynamic streams.

Why are my Next.js Partial Prerendering boundaries not rendering correctly?

Partial Prerendering requires proper Suspense boundaries around dynamic content. Build-time feedback detects misconfigurations and provides actionable guidance for safe rendering with 'use cache'.

Can I use 'use cache' with server actions in Next.js?

Yes, 'use cache' applies across server actions and data fetching. It ensures cached data is properly co-located and invalidated using updateTag() or revalidateTag() during server-side mutations.