Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is ISR (Incremental Static Regeneration) in Next.js?
ISR lets you update static pages after build time without rebuilding the whole site. It regenerates pages in the background when users visit them, keeping content fresh and fast.
Click to reveal answer
beginner
How do you enable ISR for a page in Next.js?
You add the revalidate property in getStaticProps and set it to the number of seconds after which the page should regenerate.
Click to reveal answer
intermediate
What happens when a user visits a page that needs regeneration in ISR?
The user sees the old page immediately. Next.js regenerates the page in the background. The next visitor gets the updated page.
Click to reveal answer
intermediate
Why is ISR better than rebuilding the whole site for every content change?
ISR updates only the changed pages, saving time and server resources. It keeps pages fast and content fresh without full rebuild delays.
Click to reveal answer
beginner
Which Next.js data fetching method supports ISR?
getStaticProps supports ISR by returning a revalidate value. getServerSideProps does not support ISR.
Click to reveal answer
What does the revalidate property control in ISR?
AHow often a static page regenerates in seconds
BThe number of users allowed to visit a page
CThe cache size for static files
DThe server response timeout
✗ Incorrect
The revalidate property sets the time in seconds after which Next.js regenerates the static page in the background.
When does ISR regenerate a page?
AIn the background after the <code>revalidate</code> time when a user visits
BOn every user request without caching
COnly during the initial build
DWhen the server restarts
✗ Incorrect
ISR regenerates pages in the background after the revalidate interval when a user visits the page.
Which data fetching method is used with ISR in Next.js?
A<code>getServerSideProps</code>
B<code>useEffect</code>
C<code>getStaticProps</code>
D<code>getInitialProps</code>
✗ Incorrect
ISR works with getStaticProps by adding the revalidate property.
What does a user see when a page is regenerating with ISR?
AA loading spinner until regeneration finishes
BAn error message
CA blank page
DThe old cached page immediately
✗ Incorrect
The user sees the old cached page immediately while regeneration happens in the background.
Why is ISR useful for large websites?
AIt rebuilds the entire site faster
BIt updates only changed pages, saving time and resources
CIt disables caching for all pages
DIt forces server-side rendering for all pages
✗ Incorrect
ISR updates only the pages that need changes, making updates faster and more efficient for large sites.
Explain how ISR works in Next.js and why it is beneficial compared to full static rebuilds.
Think about how static pages can stay fresh without rebuilding everything.
You got /4 concepts.
Describe the user experience when visiting a page that is being regenerated using ISR.
Focus on what the user sees and what happens behind the scenes.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of Incremental Static Regeneration (ISR) in Next.js?
easy
A. To disable static generation completely
B. To generate pages only on the client side
C. To update static pages after build without rebuilding the entire site
D. To force server-side rendering on every request
Solution
Step 1: Understand ISR concept
ISR allows static pages to be updated after the initial build without rebuilding the whole site.
Step 2: Compare options
Options B, C, and D describe client-side rendering, disabling static generation, or forcing server-side rendering, which are not ISR features.
Final Answer:
To update static pages after build without rebuilding the entire site -> Option C
Quick Check:
ISR updates static pages incrementally = A [OK]
Hint: ISR updates static pages without full rebuilds [OK]
Common Mistakes:
Confusing ISR with client-side rendering
Thinking ISR disables static generation
Believing ISR forces server-side rendering
2. Which Next.js function should you use to enable ISR by specifying a revalidation time?
easy
A. getServerSideProps
B. getStaticProps
C. getInitialProps
D. useEffect
Solution
Step 1: Identify ISR enabling function
ISR is enabled by returning a revalidate property inside getStaticProps.
Step 2: Check other options
getServerSideProps is for server-side rendering, getInitialProps is legacy, and useEffect is a React hook for client-side effects.
Final Answer:
getStaticProps -> Option B
Quick Check:
ISR uses getStaticProps with revalidate = D [OK]
Hint: Use getStaticProps with revalidate for ISR [OK]
Common Mistakes:
Using getServerSideProps instead of getStaticProps
Confusing client-side hooks with data fetching
Using deprecated getInitialProps for ISR
3. Given this code snippet, what will be the behavior of the page?
The revalidate property must be a number representing seconds, not a string.
Step 2: Verify other parts
props is correctly an object, getStaticProps can be async, and fallback is unrelated here.
Final Answer:
revalidate must be a number, not a string -> Option A
Quick Check:
revalidate type must be number = C [OK]
Hint: revalidate must be numeric seconds, not string [OK]
Common Mistakes:
Passing revalidate as string instead of number
Thinking getStaticProps can't be async
Confusing fallback with revalidate
5. You want a blog page to update its static content every 5 minutes but also show a fallback loading page on first visit to new posts. Which ISR setup is correct?
hard
A. Use getStaticProps with revalidate: 300 and fallback: 'blocking' in getStaticPaths
B. Use getServerSideProps with revalidate: 300
C. Use getStaticProps with revalidate: '300' and no fallback
D. Use getStaticPaths with fallback: false and no revalidate
Solution
Step 1: Understand ISR with fallback
To update static pages every 5 minutes (300 seconds) and show fallback loading for new pages, use revalidate: 300 in getStaticProps and fallback: 'blocking' in getStaticPaths.
Step 2: Check other options
Use getServerSideProps with revalidate: 300 uses server-side rendering, not ISR. Use getStaticProps with revalidate: '300' and no fallback has revalidate as string and no fallback. Use getStaticPaths with fallback: false and no revalidate disables fallback and revalidate, so no ISR updates or loading fallback.
Final Answer:
Use getStaticProps with revalidate: 300 and fallback: 'blocking' in getStaticPaths -> Option A
Quick Check:
ISR with fallback blocking and revalidate 300 = B [OK]
Hint: Combine revalidate with fallback: 'blocking' for ISR + loading [OK]
Common Mistakes:
Using server-side rendering instead of ISR
Passing revalidate as string
Setting fallback to false disables loading fallback