tekkiiiii/the-agency/next-cache-components
Claude Code and agent skill by tekkiiiii/the-agency
- community
Checking that the SKILL.md file is still in the repository.
Next.js 16+ Cache Components / Partial Prerendering (PPR) — mix static, cached, and dynamic content in a single route. Use when enabling cacheComponents, applying the 'use cache' directive, choosing cache profiles, or migrating from experimental.ppr. Explains the three content types: static (auto-prerendered), cached, and dynamic (Suspense).
Install
npx vskill@latest install tekkiiiii/the-agency/next-cache-componentsSKILL.md
The same SKILL.md was published earlier as tekkiiiii/the-agency/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: 'default', 'minutes', 'hours', 'days', 'weeks', 'max'
Custom lifetime:
Cache Invalidation
`cacheTag()` — tag cached content for later invalidation:
`updateTag()` — immediate invalidation within the same request (server action):
`revalidateTag()` — background revalidation (stale-while-revalidate):
Runtime Data Constraint
Cannot access cookies(), headers(), or searchParams inside use cache.
Solution — pass as arguments:
Exception: 'use cache: private' allows runtime APIs for compliance requirements.
Cache Key Generation
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
Migration from Previous Versions
| Old | 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 |
`unstable_cache` → `use cache` migration:
- No manual cache keys — use cache auto-generates from arguments
- Replace
options.tagswithcacheTag()inside the function - Replace
options.revalidatewithcacheLife({ revalidate: N })or built-in profile
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
For request-time randomness outside cache, use connection():
Source: https://officialskills.sh/vercel-labs/skills/next-cache-components
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/next-cache-components/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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/tekkiiiii/the-agency/next-cache-components)