next-cache-components

Implement Next.js 16 Cache Components with use cache directives and tag-based invalidation.

Updated May 16, 2026
One-click install
npx skills add https://github.com/MohammedHTahir/vibe-coding-platform --skill next-cache-components-mohammedhtahir
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-cache-components
Source: https://github.com/MohammedHTahir/vibe-coding-platform/tree/main/.kiro/vercel-plugin/skills/next-cache-components
Command: npx skills add https://github.com/MohammedHTahir/vibe-coding-platform --skill next-cache-components-mohammedhtahir

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves slow or over-fetching Next.js App Router pages by helping you apply Partial Prerendering (PPR) and cache directives so async data can be cached safely while dynamic parts still stream when needed.

Core Features & Use Cases

  • Partial Prerendering (PPR) guidance: Enable and structure mixed static, cached, and dynamic content in a single route using Cache Components.
  • Cache directives and profiles: Apply the use cache directive with cacheLife profiles or custom stale/revalidate/expire settings.
  • Cache invalidation with tags: Use cacheTag to tag cached outputs, updateTag for immediate same-request freshness, and revalidateTag for background revalidation.
  • Migration from unstable_cache: Convert legacy unstable_cache patterns into the Next.js 16 use cache workflow with tags and cacheLife.
  • Runtime constraints and safe refactors: Avoid using cookies/headers/searchParams inside use cache, or use use cache: private when refactoring isn’t feasible.

Quick Start

Ask the AI to update your Next.js 16 App Router route by enabling cacheComponents and converting any unstable_cache usage into a use cache function that sets cacheLife and cacheTag appropriately.

Frequently Asked Questions about next-cache-components

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

FAQPage Schema
How do I migrate unstable_cache to use cache in Next.js 16?

You can migrate unstable_cache to Next.js 16 by converting legacy patterns into a use cache function that defines cacheLife profiles and applies cacheTag for tagging cached outputs. This enables consistent revalidation behavior and tag-based invalidation.

How does Partial Prerendering work with cache components in Next.js?

Partial Prerendering (PPR) structures mixed static, cached, and dynamic content in a single route using Cache Components. It applies the use cache directive to cache async data safely while allowing dynamic parts to stream when needed.

Can I use cookies or headers inside a use cache directive in Next.js?

You cannot use cookies, headers, or searchParams inside a standard use cache directive due to runtime constraints. If refactoring isn’t feasible, you should use the use cache: private directive instead to handle request-specific data safely.

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

The best way to invalidate cached data is to use cacheTag to label cached outputs, updateTag for immediate same-request freshness, and revalidateTag to trigger background revalidation. This tag-based invalidation ensures your server-rendered content stays consistent.

How do I configure cacheLife profiles for cached Next.js App Router pages?

You configure cacheLife by applying the use cache directive with predefined cacheLife profiles or custom stale, revalidate, and expire settings. This reduces redundant work by safely caching async data in your App Router pages.

When should I enable cacheComponents in my Next.js application?

You should enable cacheComponents when you need to reduce redundant work in slow or over-fetching App Router pages. It allows you to apply Partial Prerendering (PPR) and cache directives so async data is cached safely while dynamic parts stream.