Functions

revalidateTag

Use revalidateTag in a Server Action or Route Handler to mark tagged data for revalidation. The max profile permits stale data while regeneration proceeds; one-argument immediate expiration is deprecated. Do not promise synchronous worldwide refresh. Source: https://nextjs.org/docs/app/api-reference/functions/revalidateTag. Documentation-reviewed illustrative draft; exact package and execution not verified.

Formal Syntax & Structure

nextjs syntaxnextjs
revalidateTag(tag, 'max')

Working Example

Example Snippetnextjs
// Partial authorized operation, called only after commit.import { revalidateTag, revalidatePath } from 'next/cache';export function afterCatalogChange() {  revalidateTag('catalog', 'max');  revalidatePath('/catalog');}
Next.js Reference