revalidatePath

A function from next/cache that invalidates cached data and pages for a given URL path.

In more detail

Call it in a Server Action or Route Handler after a mutation, such as revalidatePath('/products'). In an action the refreshed page comes back in the same response; elsewhere the path re-renders on its next visit.

Related terms

Taught in

References