Recall & Review
beginner
What is on-demand revalidation in Next.js?
On-demand revalidation lets you update a static page after it's built, without rebuilding the whole site. You ask Next.js to refresh the page data when something changes.
Click to reveal answer
beginner
Which Next.js function is used to trigger on-demand revalidation?
You use the
res.revalidate(path) method inside an API route to tell Next.js to update the static page at the given path.Click to reveal answer
intermediate
Why use on-demand revalidation instead of rebuilding the whole site?
It saves time and resources by updating only the changed pages, so your site stays fast and fresh without full rebuilds.
Click to reveal answer
beginner
What is a common use case for on-demand revalidation?
When content changes in a CMS or database, you can call on-demand revalidation to update the affected pages immediately.
Click to reveal answer
intermediate
How do you secure an API route that triggers on-demand revalidation?
You add a secret token check in the API route to allow only authorized requests to trigger revalidation.
Click to reveal answer
What does
res.revalidate('/path') do in Next.js?✗ Incorrect
The
res.revalidate('/path') method tells Next.js to regenerate the static page at '/path' with updated data.Where do you typically call on-demand revalidation in Next.js?
✗ Incorrect
On-demand revalidation is triggered inside an API route handler where you can call
res.revalidate().Which of these is NOT a benefit of on-demand revalidation?
✗ Incorrect
On-demand revalidation avoids full site rebuilds, so option C is not a benefit.
How can you protect your on-demand revalidation API route?
✗ Incorrect
Adding a secret token check ensures only authorized requests can trigger revalidation.
When is on-demand revalidation most useful?
✗ Incorrect
On-demand revalidation is great for fast updates when content changes often.
Explain how on-demand revalidation works in Next.js and why it is useful.
Think about how you can refresh a page after it is built without rebuilding the whole site.
You got /4 concepts.
Describe how to secure an API route that triggers on-demand revalidation in Next.js.
Consider how to prevent unauthorized users from forcing page updates.
You got /3 concepts.