using-cache-lifecycle-apis

Installation
SKILL.md

Cache Lifecycle APIs in Next.js 16

Next.js 16 introduces comprehensive cache lifecycle APIs for fine-grained control over caching behavior. These APIs work together to manage cache policies, tagging, and invalidation across both private (CDN) and remote (server) caches.

Core Lifecycle APIs

cacheLife()

Sets cache duration profiles for fetch requests and route handlers. Replaces the need for manual revalidation intervals.

import { unstable_cacheLife as cacheLife } from 'next/cache';

export async function GET() {
  'use cache';
  cacheLife('hours');

  const data = await fetch('https://api.example.com/data');
  return Response.json(data);
Related skills
Installs
4
First Seen
Feb 4, 2026