Replies: 2 comments 9 replies
-
Is it possible for your application to use fetch(url, { next: { tags: [...] } }); |
Beta Was this translation helpful? Give feedback.
-
According to the documentation the problem is now solved. The revalidatePath function now lets us revalidate the literal route segment from a dynamic path without revalidating all other dynamic segments aswell. https://nextjs.org/docs/app/api-reference/functions/revalidatePath |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
To be able to revalidate the literal route segment (e.g. post/123456) without need of revalidating all products
Non-Goals
No response
Background
Let say site has 1M of post. If one post is edited and all other are unchanged it will be nice to be able to revalidate just one which has been edited and keep remaining 999,999 without change and without need of rebuild them again.
Currently revalidatePath doesn't support this, so revalidatePath('/post/[id]') will revalidate all 1M of posts.
Proposal
Add support to revalidatePath to support literal route segment (e.g. post/123456) to be revalidated. So when revalidatePath('/post/123456') is run it will revalidate only post with id of 123456.
Beta Was this translation helpful? Give feedback.
All reactions