Caching and revalidation
Time-based ISR plus optional webhook refresh for docs pages.
The Next.js template uses two layers:
- Time-based revalidation (
revalidate = 3600) refreshes pages about once an hour. - Optional webhooks call
POST /api/revalidateso 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.