Part 11 / Topic 4 of 6
revalidateTag with { expire: 0 } — no stale window at all
Same endpoint, "immediate" mode instead:
$ curl -s -X POST http://localhost:PORT/api/swiggy-menu/revalidate -d '{"id":"m1","price":65,"mode":"immediate"}'
{"revalidated":true,"item":{"id":"m1","name":"Masala Dosa","price":65,"available":true},"mode":"immediate"}
$ time curl -s http://localhost:PORT/swiggy-menu | grep -o '₹<!-- -->[0-9]*'
₹65
curl -s http://localhost:PORT/swiggy-menu 0.00s user 0.01s system 1% cpu 0.531 total
No stale value shows up at all — the very next request blocks for ~531ms (the same simulated delay inside getCachedMenu) and returns the fresh price directly. This matches the installed revalidateTag.md reference precisely: "{ expire: 0 }: stale content is never served, so the next request is a blocking revalidate/cache miss. Use it when the caller needs the data gone immediately and you cannot use updateTag." A Route Handler is exactly the "cannot use updateTag" case the docs have in mind — updateTag is Server-Actions-only, section 5's subject.
Done here? The practice set for Part 11 — including the solutions — is on the part page.