Next.js campaign layout forces broad cache invalidation via revalidatePath "layout"
A developer audited the revalidatePath calls in the Nakodo codebase, finding 46 calls across six Server Action files that together handle 62 exported actions. Half of those calls pass "layout" as the second argument, always targeting campaign paths, because the campaign header showing name, status and progress lives in the layout and would otherwise contradict the page body after an update. The author accepts the cost that invalidating the whole subtree re-renders sibling tabs when they are next visited, since those pages are per-user dynamic and cheap to fetch. Tags were not used anywhere in the codebase, since a finer-grained scheme would require more machinery than the saved queries justify. Redirect-based actions were also grouped separately, with the author noting their correctness depends on destinations staying dynamic if staleTimes is ever changed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in