cache-components

Apply Cache Components and Partial Prerendering patterns to Next.js apps.

Updated Jan 14, 2026
One-click install
npx skills add https://github.com/joshkellett87/useful-skills --skill cache-components-joshkellett87
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cache-components
Source: https://github.com/joshkellett87/useful-skills/tree/main/cache-components
Command: npx skills add https://github.com/joshkellett87/useful-skills --skill cache-components-joshkellett87

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cache Components enables developers to co-locate caching decisions with data-fetching components, enabling static shells plus streaming content to optimize performance in Next.js apps.

Core Features & Use Cases

  • Auto-activation when cacheComponents is true in next.config, enabling proactive guidance during development.
  • Guidance for using 'use cache', cacheLife, cacheTag, updateTag, revalidateTag, and Suspense to build granular caching boundaries and SWR-like updates.
  • Debugging, performance profiling, and migration guidance for moving from legacy revalidate/dynamic configurations to Cache Components.

Quick Start

Enable Cache Components in next.config.ts, then annotate data-fetching functions with 'use cache', apply cacheLife and cacheTag for invalidation, and wrap dynamic content with Suspense to enable partial prerendering.

Frequently Asked Questions about cache-components

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

FAQPage Schema
How do I use 'use cache' with Suspense for partial prerendering in Next.js?

Cache Components allow developers to co-locate caching decisions with data-fetching components, enabling static shells plus streaming content to optimize Next.js app performance without manual configuration.

How do I migrate from legacy revalidate configurations to Next.js Cache Components?

Apply the 'use cache' directive to data-fetching functions, use cacheLife and cacheTag for granular invalidation boundaries, and wrap dynamic content with Suspense to enable partial prerendering in Next.js apps.

What is the best way to invalidate cached data using cacheTag and revalidateTag in Next.js?

Assign cacheTag to specific cache boundaries and trigger revalidateTag or updateTag to execute targeted SWR-like updates, enabling granular invalidation without clearing the entire cache.

Does Next.js partial prerendering work with server actions and data fetching?

Yes, Cache Components scope covers server actions and data fetching, applying 'use cache' directives to define granular caching boundaries for shared content within Next.js applications.

Why are my Next.js Cache Components not activating during development?

Cache Components require cacheComponents to be set to true in next.config.ts and activation via SKILL.md frontmatter to provide proactive guidance during development.