next-cache-components

Automate Next.js 16+ caching with cacheComponents, 'use cache', cacheLife, and cacheTag.

Updated Feb 3, 2026
One-click install
npx skills add https://github.com/eKoh951/hytale-gg --skill next-cache-components-ekoh951
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-cache-components
Source: https://github.com/eKoh951/hytale-gg/tree/main/.windsurf/skills/next-cache-components
Command: npx skills add https://github.com/eKoh951/hytale-gg --skill next-cache-components-ekoh951

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cache Components allow mixing static, cached, and dynamic content in a single route for Next.js 16+.

Core Features & Use Cases

  • Enable cache components across app with cacheComponents: true in next.config.ts
  • Use the 'use cache' directive at various levels (page, component, function)
  • Employ cacheLife, cacheTag, and updateTag for fine-grained caching and invalidation
  • Use to implement Static (auto-prerendered), Cached (use cache), and Dynamic (Suspense) content models
  • Example: cache a user dashboard data while keeping static shell for fast load

Quick Start

Enable Cache Components in next.config.ts and make a component use the 'use cache' directive to cache content.

Frequently Asked Questions about next-cache-components

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

FAQPage Schema
How do I cache specific components in Next.js while keeping other parts dynamic?

Caching specific components in Next.js is done using the 'use cache' directive at the page, component, or function level. This allows you to mix static, cached, and dynamic content within a single route by wrapping dynamic sections in Suspense boundaries.

What is the best way to set up partial prerendering in Next.js 16?

Partial prerendering in Next.js 16 is set up by enabling cacheComponents: true in next.config.ts. This automatically prerenders static content while integrating cached and dynamic content models.

Does Next.js support fine-grained cache invalidation for cached pages?

Next.js supports fine-grained cache invalidation through cacheLife, cacheTag, and updateTag patterns. These directives control caching behavior and allow targeted updates without invalidating the entire route.

Can I cache a user dashboard's data while keeping the page shell static?

You can cache user dashboard data while keeping the shell static by applying the 'use cache' directive to the data components. The surrounding static shell is auto-prerendered for fast loads.

Do I need to enable cacheComponents in next.config.ts to use the 'use cache' directive?

You need to enable cacheComponents: true in next.config.ts to use the 'use cache' directive. This configuration enforces support for partial prerendering and mixed static and dynamic content models.