openai/plugins/next-cache-components
Claude Code and agent skill by openai/plugins
- vendor
Checking that the SKILL.md file is still in the repository.
Next.js 16 Cache Components guidance — PPR, use cache directive, cacheLife, cacheTag, updateTag, and migration from unstable_cache. Use when implementing partial prerendering, caching strategies, or migrating from older Next.js cache patterns.
Install
npx vskill@latest install openai/plugins/next-cache-componentsSKILL.md
The same SKILL.md was published earlier as openai/plugins/next-cache-components.
Cache Components (Next.js 16+)
Cache Components enable Partial Prerendering (PPR) - mix static, cached, and dynamic content in a single route.
Enable Cache Components
This replaces the old experimental.ppr flag.
Three Content Types
With Cache Components enabled, content falls into three categories:
1. Static (Auto-Prerendered)
Synchronous code, imports, pure computations - prerendered at build time:
2. Cached (use cache)
Async data that doesn't need fresh fetches every request:
3. Dynamic (Suspense)
Runtime data that must be fresh - wrap in Suspense:
use cache Directive
File Level
Component Level
Function Level
Cache Profiles
Built-in Profiles
cacheLife() - Custom Lifetime
Built-in profiles: 'default', 'minutes', 'hours', 'days', 'weeks', 'max'
Inline Configuration
Cache Invalidation
cacheTag() - Tag Cached Content
updateTag() - Immediate Invalidation
Use when you need the cache refreshed within the same request:
revalidateTag() - Background Revalidation
Use for stale-while-revalidate behavior:
Runtime Data Constraint
Cannot access cookies(), headers(), or searchParams inside use cache.
Solution: Pass as Arguments
Exception: use cache: private
For compliance requirements when you can't refactor:
Cache Key Generation
Cache keys are automatic based on:
- Build ID - invalidates all caches on deploy
- Function ID - hash of function location
- Serializable arguments - props become part of key
- Closure variables - outer scope values included
Complete Example
Migration from Previous Versions
| Old Config | Replacement | |
|---|---|---|
experimental.ppr | cacheComponents: true | |
dynamic = 'force-dynamic' | Remove (default behavior) | |
dynamic = 'force-static' | 'use cache' + cacheLife('max') | |
revalidate = N | cacheLife({ revalidate: N }) | |
unstable_cache() | 'use cache' directive |
Migrating unstable_cache to use cache
unstable_cache has been replaced by the use cache directive in Next.js 16. When cacheComponents is enabled, convert unstable_cache calls to use cache functions:
Before (`unstable_cache`):
After (`use cache`):
Key differences:
- No manual cache keys -
use cachegenerates keys automatically from function arguments and closures. ThekeyPartsarray fromunstable_cacheis no longer needed. - Tags - Replace
options.tagswithcacheTag()calls inside the function. - Revalidation - Replace
options.revalidatewithcacheLife({ revalidate: N })or a built-in profile likecacheLife('minutes'). - Dynamic data -
unstable_cachedid not supportcookies()orheaders()inside the callback. The same restriction applies touse cache, but you can use'use cache: private'if needed.
Limitations
- Edge runtime not supported - requires Node.js
- Static export not supported - needs server
- Non-deterministic values (
Math.random(),Date.now()) execute once at build time insideuse cache
For request-time randomness outside cache:
Sources:
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 16 Sep 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/vercel/skills/next-cache-components/SKILL.md
Popularity
- Repository stars
- 6,799
- Repository forks
- 889
- 7-day trend score
- 44
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 8 Sep 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/openai/plugins/next-cache-components)