Concepts

Caching and revalidation

Time-based ISR plus optional webhook refresh for docs pages.

The Next.js template uses two layers:

  1. Time-based revalidation (revalidate = 3600) refreshes pages about once an hour.
  2. Optional webhooks call POST /api/revalidate so publish and update events refresh paths immediately.

Without webhooks

No extra setup. After you publish in Elmapi, the site picks up changes on the next hourly refresh (or the next visit after that window).

With webhooks

Set REVALIDATE_SECRET, point an Elmapi webhook at /api/revalidate, and include the payload. The route verifies the secret or signature, then revalidates the affected docs paths and the sitemap.