Next.js · Middle · Question 38 of 75

How does revalidatePath('/blog/[slug]', 'page') differ from revalidatePath('/blog/my-post')?

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.

Further reading

Problem with a question

Next.js · Middle · question 38

Test yourself

Take the Next.js · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz