Part 11 / Topic 1 of 6
Two kinds of revalidation — and this install's own account of the difference
Part 10 already built time-based revalidation without naming it that way: every cacheLife profile has a revalidate window after which the next request gets served the current (now-stale) value immediately while a fresh copy computes in the background — pure elapsed time, no one has to call anything. This install's own internals doc, node_modules/next/dist/docs/01-app/02-guides/how-revalidation-works.md, draws the line precisely:
"Time-based revalidation uses a stale-while-revalidate pattern. The cached content is served immediately, and a background regeneration is triggered when the content's age exceeds the
cacheLifeorrevalidateduration... On-demand revalidation explicitly invalidates cached content by callingrevalidateTag()orrevalidatePath(). The next request to that content triggers a fresh render."
This part is entirely about the second kind: you decide the moment invalidation happens — right after a price changes, right after a review is posted — instead of waiting out a window. Udupi Grande's menu (harness/app/swiggy-menu/lib/menu.ts) and its cached snapshot (harness/app/swiggy-menu/lib/cached-menu.ts, Part 10's own running example extended here) give this part a real, mutable write to invalidate against — Mandi Fresh's data in Parts 9–10 was read-only on purpose, and on-demand revalidation has nothing to prove against data that never changes.
Done here? The practice set for Part 11 — including the solutions — is on the part page.