Conceptual
Login

Cache Revalidation in Next.js

Time-based revalidation (the revalidate option) serves stale data while re-fetching in the background after N seconds; tag-based revalidation labels fetches with cache tags and purges them on demand via revalidateTag, with revalidatePath doing the same per route. On-demand revalidation from a Server Action or route handler is how mutations make their own writes visible.

This Concept is waiting for its first lesson!

Time-based revalidation (the revalidate option) serves stale data while re-fetching in the background after N seconds; tag-based revalidation labels fetches with cache tags and purges them on demand via revalidateTag, with revalidatePath doing the same per route. On-demand revalidation from a Server Action or route handler is how mutations make their own writes visible.

Are you a teacher? Sign in to start contributing.

Sign In