Recall & Review
beginner
What is time-based revalidation in Next.js?
Time-based revalidation is a way to update static pages after a set time interval. It lets Next.js regenerate the page in the background while serving the old page, so users see fresh content without waiting.
Click to reveal answer
beginner
How do you set a time-based revalidation interval in Next.js?
You set the 'revalidate' property in the 'getStaticProps' function's return object. For example, 'revalidate: 10' means Next.js will regenerate the page at most every 10 seconds.
Click to reveal answer
beginner
What happens when a user requests a page before the revalidation time expires?
Next.js serves the cached static page immediately without regenerating it. The page stays the same until the revalidation time passes.
Click to reveal answer
intermediate
Explain the user experience during background regeneration in time-based revalidation.
Users see the old page instantly while Next.js regenerates the page in the background. Once done, the new page replaces the old one for future visitors, ensuring fast load and fresh content.
Click to reveal answer
intermediate
Why is time-based revalidation useful for websites with frequently changing data?
It balances performance and freshness. Pages load fast from cache but update regularly, so users get up-to-date content without slow page loads.
Click to reveal answer
In Next.js, where do you specify the time interval for revalidation?
✗ Incorrect
The 'revalidate' property inside getStaticProps tells Next.js how often to regenerate the page.
What does Next.js do when a page is requested after the revalidation time has passed?
✗ Incorrect
Next.js serves the cached page immediately and regenerates the page in the background for future requests.
What is the main benefit of time-based revalidation?
✗ Incorrect
Time-based revalidation updates pages regularly while keeping fast load times by serving cached pages.
If you set 'revalidate: 60', how often will Next.js regenerate the page?
✗ Incorrect
'revalidate' is in seconds, so 60 means every 60 seconds (1 minute).
Which Next.js data fetching method supports time-based revalidation?
✗ Incorrect
Only getStaticProps supports time-based revalidation with the 'revalidate' property.
Describe how time-based revalidation works in Next.js and why it improves user experience.
Think about how Next.js updates static pages after a set time without making users wait.
You got /4 concepts.
Explain how you would implement a page that updates every 30 seconds using Next.js time-based revalidation.
Focus on the revalidate property and what happens when users visit the page.
You got /4 concepts.