Understanding How the "use cache" Directive Works in Production Next.js Apps
This article demonstrates Next.js v16.1 with a Node.js backend to mock API responses. Full repo: https://github.com/dialoghmari/nextjs-cache-demo
Scenario 1: Fully Static Page (No Cache Directive)
Setup:
- Page component has
"use cache": No - Child components have
"use cache": No
When a page is completely static (no "use cache" anywhere), all components are rendered as HTML at build time. On Vercel, requests look like this:

Result: Pure static HTML served directly from CDN.
Scenario 2: Static Page with Cached Components
Setup:
- Page component has
"use cache": No - Child components have
"use cache": Yes
When only child components use the cache directive:
1. First Visit: Vercel invokes an ISR Function to render the page for the first time and updates the ISR cache.

2. Second Visit (Ctrl+R): Vercel serves from Cache because the page has already been built.

3. After Cache Expiry: Vercel serves the stale HTML from Cache, then invokes an ISR Function in the background to refresh it. This also triggers an ISR cache update.

Scenario 3: Dynamic Page with Mixed Components
Setup:
- Page component has
"use cache": No - Some child components have
"use cache": Yes - Some child components have
"use cache": No (fully SSR)
1. First Load: Vercel invokes Cache for components that have been cached previously, responds with HTML, then invokes a Function to fetch SSR component data and an ISR Function to build/refresh any uncached components. Finally, it streams both parts (SSR and ISR components).

2. Reload (Ctrl+R): Vercel serves cached components from Cache, then invokes a Function to stream the SSR component.

Scenario 4: Cached Page Component
Setup:
- Page component has
"use cache": Yes (withcacheLife('hours')) - Child components have
"use cache": Mixed (yes and no)
When the page itself uses the cache directive:
1. First Visit: Vercel invokes an ISR Function to build all components (regardless of their individual cache settings) and returns the HTML.

2. Reload: Vercel simply serves from Cache and returns the HTML immediately.

Scenario 5: Mixed Caching Strategies
Setup:
- Page component has
"use cache": No - Multiple child components with different cache profiles (5s, 15s, 30s)
- One SSR component (no cache)
Every page load invokes Cache to return the static HTML shell, then invokes a Function to build all RSC components (both cached and SSR).

Key Takeaways
- Component-level caching works independently from page-level caching
- ISR Functions handle first renders and cache refreshes
- Cached responses serve stale content while revalidating in the background
- Mixed strategies let you optimize different parts of the page independently
- SSR components always fetch fresh data on every request