cache-components
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR).
Skill by evgeshniyzik-dev
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/evgeshniyzik-dev-cache-components
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, backend, data, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
cache-components- Description
- Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
- License
- MIT
- Instructions
- 457 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (4)
- PATTERNS.md
- REFERENCE.md
- SKILL.md
- TROUBLESHOOTING.md
SKILL.md (first lines)
# Next.js Cache Components
> **Auto-activation**: This skill activates automatically in projects with `cacheComponents: true` in next.config.
## Project Detection
When starting work in a Next.js project, check if Cache Components are enabled:
```bash
# Check next.config.ts or next.config.js for cacheComponents
grep -r "cacheComponents" next.config.* 2>/dev/null
```
If `cacheComponents: true` is found, apply this skill's patterns proactively when:
- Writing React Server Components
- Implementing data fetching
- Creating Server Actions with mutations
- Optimizing page performance
- Reviewing existing component code
Cache Components enable **Partial Prerendering (PPR)** - mixing static HTML shells with dynamic streaming content for optimal performance.
## Philosophy: Code Over Configuration
Cache Components represents a shift from **segment configuration** to **compositional code**:
| Before (Deprecated) | After (Cache Components) |
| --------------------------------------- | ----------------------------------------- |
| `export const revalidate = 3600` | `cacheLife('hours')` inside `'use cache'` |
| `export const dynamic = 'force-static'` | Use `'use cache'` and Suspense boundaries |
| All-or-nothing static/dynamic | Granular: static shell + cached + dynamic |
**Key Principle**: Components co-locate their caching, not just their data. Next.js provides build-time feedback to guide you toward optimal patterns.
## Core Concept
```
┌─────────────────────────────────────────────────────┐
│ Static Shell │
│ (Sent immediately to browser) │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Header │ │ Cached │ │ Suspense │ │
│ │ (static) │ │ Content │ │ Fallback │ │
│ └─────────────┘ └─────────────┘ └──────┬──────┘ │
│ │ │
│ ┌──────▼──────┐ │
│ │ Dynamic │ │
│ │ (streams) │ │
│ └─────────────┘ │
└─────────────────────────────────────────────────────┘
```
## Mental Model: The Caching Decision Tree
When writing a React Server Component, ask these questions in order:
```
┌─────────────────────────────────────────────────────────┐
│ Does this component fetch data or perform I/O? │
└─────────────────────┬───────────────────────────────────┘
│
┌──────────▼──────────┐
│ YES │ NO → Pure component, no action needed
└──────────┬──────────┘
│
┌─────────────────▼─────────────────┐
│ Does it depend on request context? │
│ (cookies, headers, searchParams) │
└─────────────────┬─────────────────┘
│
┌────────────┴────────────┐
│ │
┌────▼────┐ ┌─────▼─────┐
│ YES │ │ NO │
└────┬────┘ └─────┬─────┘
│ │
│ ┌─────▼─────────────────┐
│ │ Can this be cached? │
│ │ (same for all users?) │
│ └─────┬─────────────────┘
│ │
│ ┌──────────┴──────────┐
│ │ │
│ ┌────▼────┐ ┌─────▼─────┐
│ │ YES │ │ NO │
│ └────┬────┘ └─────┬─────┘
│ │ │
│ ▼ │
│ 'use cache' │
│ + cacheTag() │
│ + cacheLife() │
│ │
└──────────────┬─────────────────────┘
│
▼
Wrap in <Suspense>
(dynamic streaming)
```
**Key insight**: The `'use cache'` directive is for data that's the _same across users_. User-specific data stays dynamic with Suspense.
## Quick Start
### Enable Cache Components
```typescript
// next.config.ts
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
cacheComponents: true,
}
export default nextConfig
```
### Basic UsageFrom evgeshniyzik-dev/nextjs, MIT.
More from evgeshniyzik-dev/nextjs
- 0.409score
runtime-debug
evgeshniyzik-dev
Debug and verification workflow for runtime-bundle and module-resolution regressions.
SkillDFreshness: DClaude Code +9 - 0.409score
flags
evgeshniyzik-dev
How to add or modify Next.js experimental feature flags end-to-end.
SkillDFreshness: DClaude Code +9 - 0.409score
react-vendoring
evgeshniyzik-dev
React vendoring and react-server layer boundaries.
SkillDFreshness: DClaude Code +9 - 0.409score
router-act
evgeshniyzik-dev
How to write end-to-end tests using createRouterAct and LinkAccordion.
SkillDFreshness: DClaude Code +9 - 0.409score
write-guide
evgeshniyzik-dev
Generates technical guides that teach real-world use cases through progressive examples.
SkillDFreshness: DClaude Code +9 - 0.409score
dce-edge
evgeshniyzik-dev
DCE-safe require() patterns and edge runtime constraints.
SkillDFreshness: DClaude Code +9 - 0.409score
v8-jit
evgeshniyzik-dev
V8 JIT optimization patterns for writing high-performance JavaScript in Next.js server internals.
SkillDFreshness: DClaude Code +9 - 0.409score
write-api-reference
evgeshniyzik-dev
Produces API reference documentation for Next.js APIs: functions, components, file conventions, directives, and config options.
SkillDFreshness: DClaude Code +9 - 0.406score
next-compile
evgeshniyzik-dev
Check Next.js compilation errors via a running dev server.
SkillDFreshness: DClaude Code +9 - 0.390score
update-docs
evgeshniyzik-dev
This skill should be used when the user asks to "update documentation for my changes", "check docs for this PR", "what docs need updating", "sync docs with…
SkillDFreshness: DClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jan 8, 2026 (9 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/evgeshniyzik-dev/nextjs
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from evgeshniyzik-dev
- 0.409score
runtime-debug
evgeshniyzik-dev
Debug and verification workflow for runtime-bundle and module-resolution regressions.
SkillDFreshness: DClaude Code +9 - 0.409score
flags
evgeshniyzik-dev
How to add or modify Next.js experimental feature flags end-to-end.
SkillDFreshness: DClaude Code +9 - 0.409score
react-vendoring
evgeshniyzik-dev
React vendoring and react-server layer boundaries.
SkillDFreshness: DClaude Code +9 - 0.409score
router-act
evgeshniyzik-dev
How to write end-to-end tests using createRouterAct and LinkAccordion.
SkillDFreshness: DClaude Code +9 - 0.409score
write-guide
evgeshniyzik-dev
Generates technical guides that teach real-world use cases through progressive examples.
SkillDFreshness: DClaude Code +9 - 0.409score
dce-edge
evgeshniyzik-dev
DCE-safe require() patterns and edge runtime constraints.
SkillDFreshness: DClaude Code +9
Cite this page
cache-components skill. Agent Mart. https://agentmart.dev/skills/evgeshniyzik-dev-cache-components (last updated 2026-10-24)