What's the difference between revalidatePath and revalidateTag in Next.js? #37
Answered
by
Kevinchamplin
Kevinchamplin
asked this question in
Q&A
-
|
What's the difference between revalidatePath and revalidateTag in Next.js? |
Beta Was this translation helpful? Give feedback.
Answered by
Kevinchamplin
Jun 13, 2026
Replies: 1 comment
-
|
revalidatePath(path) invalidates the cache for a specific route, so the next request to that page rebuilds it. revalidateTag(tag) invalidates every fetch that was tagged with that string, across any route. Use tags when the same data feeds multiple pages (revalidate once, all consumers update); use path when you just need one route refreshed. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kevinchamplin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
revalidatePath(path) invalidates the cache for a specific route, so the next request to that page rebuilds it. revalidateTag(tag) invalidates every fetch that was tagged with that string, across any route. Use tags when the same data feeds multiple pages (revalidate once, all consumers update); use path when you just need one route refreshed.