Test On-Demand ISR

This page is designed to test on-demand revalidation. Use the API endpoint to trigger an immediate revalidation.

Page Generated At

2026-04-30T01:38:56.416Z

Random Number (Changes on Revalidation)

3003

How to Test On-Demand Revalidation

  1. Note the current timestamp and random number above.
  2. Send a POST request to /api/revalidate with the path you want to revalidate and the secret token in the x-secret-token header:
curl -X POST "https://your-domain.com/api/revalidate" \
  -H "Content-Type: application/json" \
  -H "x-secret-token: YOUR_SECRET_TOKEN" \
  -d '{"path": "/test-isr"}'

After revalidation, refresh this page to see the new timestamp and random number immediately — no need to wait for the 60-second interval!

Revalidation Configuration

  • Time-based ISR: revalidate = 60 seconds
  • On-demand ISR: Via /api/revalidate API route
  • Method: revalidatePath() from Next.js Cache API
  • Auth: Header x-secret-token matching SECRET_TOKEN env variable