Next.js · Middle · Question 3 of 75
What does revalidatePath('/blog') do after a mutation?
- ✓Correct answer: Marks the cached data and UI of the
/blogroute as stale - 2Restarts the Next.js server to clear the whole cache
- 3Redirects the user to the
/blogpage after the action
Explanation
The next request to /blog gets fresh data. When called in a Server Action, the updated UI comes back right in the action's response. For targeted invalidation of data used on many pages, tags are more convenient (cacheTag + revalidateTag/updateTag).