.claude-plugin/plugins/cache-components/README.md
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR).
This plugin provides a comprehensive skill that:
cacheComponents: true'use cache' directive, cacheLife(), cacheTag(), and invalidation APIsrevalidate/dynamic segment configs/plugin marketplace add vercel/next.js
/plugin install cache-components@nextjs
Or install via CLI:
claude plugin install cache-components@nextjs
Add to your project's .claude/settings.json to auto-enable for all team members:
{
"enabledPlugins": {
"cache-components@nextjs": true
}
}
| File | Description |
|---|---|
SKILL.md | Core concepts, APIs, and proactive application guidelines |
REFERENCE.md | Complete API reference, generateStaticParams, deprecated configs |
PATTERNS.md | 12 production patterns including subshell composition |
TROUBLESHOOTING.md | Build errors, debugging techniques, common issues |
Once installed, the skill automatically activates when:
cacheComponents: true'use cache' directiveWhen you provide generateStaticParams, Next.js renders ALL permutations:
generateStaticParams returns:
[{ category: 'jackets', slug: 'bomber' }]
Next.js renders:
/products/jackets/bomber ← Complete page
/products/jackets/[slug] ← Category subshell (reusable!)
/products/[category]/[slug] ← Fallback shell
| Old (Deprecated) | New (Cache Components) |
|---|---|
export const revalidate = 3600 | cacheLife('hours') inside 'use cache' |
export const dynamic = 'force-static' | Use 'use cache' + Suspense |
This plugin lives in the Next.js repository at .claude-plugin/plugins/cache-components/.
To contribute improvements:
.claude-plugin/plugins/cache-components/skills/cache-components/claude --plugin-dir .claude-plugin/plugins/cache-components'use cache', cacheLife(), cacheTag(), updateTag(), revalidateTag()