Functions
cacheLife
Requires Cache Components enabled and a cache directive scope. Select a documented profile name or a lifetime object, with durations in seconds. Client stale time controls reuse of the navigation result; server revalidate permits background regeneration and expire bounds stale reuse. Verify actual behavior in the selected version. Source: https://nextjs.org/docs/app/api-reference/functions/cacheLife. Documentation-reviewed illustrative draft; exact package and execution not verified.
Formal Syntax & Structure
nextjs syntaxnextjs
cacheLife(profile)Working Example
Example Snippetnextjs
import { cacheLife } from 'next/cache';export async function publicEdition() { 'use cache'; cacheLife({ stale: 60, revalidate: 300, expire: 1800 }); return { title: 'Fern Atlas', edition: 2 };}