Next.js · Middle · Question 38 of 75
How does revalidatePath('/blog/[slug]', 'page') differ from revalidatePath('/blog/my-post')?
- ✓Correct answer: The first covers all pages of the pattern, the second one specific path
- 2No difference: the second argument
'page'is simply ignored - 3The first invalidates only the layout, the second only the page
Explanation
If you pass a pattern with a dynamic segment, you must specify the type 'page' or 'layout', and invalidation affects all paths matching the pattern. A specific path invalidates one page. revalidatePath('/', 'layout') resets the whole app.