Skip to content
masterclass Buddy

Next.js 16+ · Function

cacheLife

cacheLife sets the lifetime of cached functions and components in the Next.js App Router. It works inside a use cache scope and accepts preset names, custom profile names, or timing objects.

Last updated

Since
v16.0.0

Syntax

cacheLife(profile)
cacheLife({ stale, revalidate, expire })

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • cacheComponents
  • use cache
  • staleTimes
  • revalidateTag
  • revalidatePath
  • updateTag
  • refresh

Source: cacheLife. Checked 2026-11-03.