Cache invalidation done right: revalidateTag patterns
Surgical Next.js cache invalidation driven by Contentful webhooks.

Phil Karlton was right: cache invalidation is hard. But it's a lot easier when your CMS tells you exactly what changed.
Our /api/revalidate route accepts a tag or path from Contentful's webhook, validates the signing secret, and calls revalidateTag. The fetch layer tags every Contentful response with the entry ID, so updates propagate within seconds.
The end result: editors publish, and the change appears on the live site without a redeploy or a manual cache flush.