Next.js · Senior · Question 20 of 75
How do you implement on-demand ISR via a CMS webhook?
- ✓Correct answer: A Route Handler checks a secret and calls
revalidateTag/revalidatePath - 2Set up a cron job that rebuilds the whole project every 5 minutes
- 3Call
router.refresh()from the CMS admin via its SDK
Explanation
The CMS sends a POST to /api/revalidate with a secret and the ID of the changed entry; the handler verifies the signature and invalidates the relevant tags. Pages update on the next request, without a full rebuild. router.refresh() is a client-side API.