Next.js Discord

Discord Forum

Next 14 revalidateTag & fetch { tags: [] }

Unanswered
Podenco Canario posted this in #help-forum
Open in Discord
Podenco CanarioOP
I am trying to understand more about the behavior for caching & tags in next 14.
scenario - lets say i fetch some posts with tags: [ "posts" ], and later use revalidateTag("posts") i understand the cache for the entire posts is purged and we get a fresh data call for posts.
Now -
1) what happens if i have a webhook from the CMS to the Next api/revalidate and i only change 1 post and call revalidateTag("posts") it fetches data for the entire collection again?
2) instead if i use tags: ["post-id1"] and revalidateTag("post-id1") it should burst cache for only that "post-id1" and not touch the rest right? is it a better approach?
3) if i have 8-10 contentTypes and for each of these contentTypes there is a "list" page and a "detail" page, which of the above 2 approach makes more sense perf wise?
4) what is the utility of tags: ['a', 'b'] how is it used in a relevant use case?
5) In Vercel infra, all these caches are maintained in server side on any specific place or way??

Thank you for reading and appreciate any help!!

0 Replies