next-cache

Guide correct use of Next.js 15 cache layers and revalidation rules.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/ashwnn/agent-config --skill next-cache
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-cache
Source: https://github.com/ashwnn/agent-config/tree/main/skills/next-cache
Command: npx skills add https://github.com/ashwnn/agent-config --skill next-cache

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Next.js 15 caching presents four distinct layers and complex revalidation rules that often lead to stale data or over-fetching. This guide helps developers choose the right caching strategy to optimize data freshness and performance across applications.

Core Features & Use Cases

  • Exposes and explains the four caches:
    • Request Memoization (in-memory, per render)
    • Data Cache (server-side, persistent)
    • Full Route Cache (server-side HTML cache)
    • Router Cache (client-side browser cache)
  • Provides guidance on when to apply static content, ISR, or on-demand revalidation, including patterns for tag-based and path-based invalidation
  • Real-world scenario: building a data-heavy Next.js app with frequently updated dashboards and product lists, applying proper revalidation to balance freshness, latency, and server load.

Quick Start

Determine the caching requirements for a given page, then apply the Next.js 15 caching layers with appropriate revalidation settings to meet freshness and performance goals.

Frequently Asked Questions about next-cache

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

FAQPage Schema
What are the four caching layers in Next.js 15?

Next.js 15 caching consists of four layers: Request Memoization for per-render in-memory deduplication, Data Cache for persistent server-side storage, Full Route Cache for server-side HTML, and Router Cache for client-side browser navigation.

How do I revalidate stale data in a Next.js 15 application?

To revalidate stale data in Next.js 15, apply on-demand revalidation using tag-based or path-based invalidation via server actions, route exports, and specific fetch options to enforce correct cache behavior and update data freshness.

When should I use ISR versus dynamic revalidation in Next.js?

Use Next.js ISR for static content that updates periodically to balance latency and server load, and choose dynamic revalidation with tags or paths for frequently updated data like dashboards requiring immediate freshness.

Why does my Next.js 15 client navigation show stale data?

Stale data during Next.js client navigation often occurs when the Router Cache serves outdated content, requiring proper configuration of route exports and revalidation settings to enforce correct cache behavior across server data fetches.

Can I use Next.js 15 caching strategies for data-heavy dashboards?

Yes, Next.js 15 caching strategies support data-heavy dashboards by applying proper revalidation patterns across data fetches and route rendering to balance data freshness, latency, and server load effectively.