On-demand Revalidation in all dynamic paths from specific route #38292
Replies: 5 comments 7 replies
-
Yes that would be useful indeed. However it seems demanding in terms of performance, not sure though |
Beta Was this translation helpful? Give feedback.
-
On-demand ISR doesn't quite make sense without regex. For example, if we have a header menu change (coming from CMS), it should invalidate all pages. Do we have any support for that? @leerob |
Beta Was this translation helpful? Give feedback.
-
Hi, does the revalidate method now support regex? like this, |
Beta Was this translation helpful? Give feedback.
-
Hi, any update regarding this? This would be very helpful @leerob |
Beta Was this translation helpful? Give feedback.
-
Good news, this is now possible through "cache tags" in the Next.js App Router: https://nextjs.org/docs/app/api-reference/functions/revalidateTag Rather than invalidating multiple paths, you would tag multiple related fetches, and then revalidate them all at once. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
Today is possible to revalidate ONE route with res.revalidate()
But it would be interesting if we could revalidate all paths from a dynamic route, like in the exemple below
Describe the solution you'd like
Accept a regex or a pattern in res.revalidate() so we could revalidate multiple paths at once.
Describe alternatives you've considered
Accept regex or a pattern in params to trigger the bulk revalidation.
Beta Was this translation helpful? Give feedback.
All reactions