Skip to content
QuiznExam

Data Fetching (SSR, SSG, ISR) in Next.js Quiz – 15 Questions with Answers

Test your knowledge of data fetching in Next.js with 15 questions covering Server-Side Rendering (SSR), Static Site Generation (SSG), Incremental Static Regeneration (ISR), caching, revalidation, and rendering strategies.

15
Questions
12 min
Time limit
Medium
Difficulty

No sign-up needed · Last updated:

Save your score

At least 8 characters.

Forgot password?

Related quizzes

All 15 questions and answers Spoilers: this shows the questions and answers. Try the quiz first! Open
  1. 1. What does SSR stand for in Next.js?

    • A. Static Server Rendering
    • B. Server-Side Rendering
    • C. Secure Server Response
    • D. Server Static Routing
    Show answer

    B. Server-Side Rendering

    SSR stands for Server-Side Rendering, where the server generates the HTML for a request rather than relying entirely on pre-generated static HTML.

  2. 2. What is the main characteristic of Static Site Generation (SSG)?

    • A. Pages are generated at build time
    • B. Pages are generated only in the browser
    • C. Pages are generated after every database query
    • D. Pages are generated only after a user submits a form
    Show answer

    A. Pages are generated at build time

    With SSG, pages can be generated ahead of time during the build process and then served as static content.

  3. 3. What does ISR stand for in Next.js?

    • A. Immediate Server Rendering
    • B. Incremental Static Regeneration
    • C. Internal Static Routing
    • D. Incremental Server Requests
    Show answer

    B. Incremental Static Regeneration

    ISR stands for Incremental Static Regeneration. It allows statically generated content to be updated or regenerated after the initial build.

  4. 4. Which rendering strategy is generally suitable when a page needs fresh data for each request?

    • A. SSR
    • B. SSG only
    • C. Static HTML only
    • D. Build-time rendering only
    Show answer

    A. SSR

    SSR is appropriate when the HTML needs to be generated on the server based on request-time data.

  5. 5. Which rendering strategy is generally suitable for content that changes rarely and can be generated ahead of time?

    • A. SSR
    • B. SSG
    • C. Client-only rendering
    • D. Request-time rendering
    Show answer

    B. SSG

    SSG is well suited to content that does not need to be generated for every request and can be prepared ahead of time.

  6. 6. What is a major benefit of ISR?

    • A. It completely disables caching
    • B. It allows static content to be updated without rebuilding the entire site for every content change
    • C. It requires every page to be rendered in the browser
    • D. It prevents pages from being cached
    Show answer

    B. It allows static content to be updated without rebuilding the entire site for every content change

    ISR combines static generation with revalidation, allowing selected content to be regenerated as it becomes stale.

  7. 7. In the Next.js App Router, which option can be used with fetch to specify a revalidation interval?

    • A. next.revalidate
    • B. cache.refresh
    • C. revalidate.time
    • D. static.interval
    Show answer

    A. next.revalidate

    In the App Router, fetch can use the next.revalidate option, such as fetch(url, { next: { revalidate: 60 } }), to specify a revalidation period.

  8. 8. What does a revalidation period of 60 seconds generally indicate for a cached fetch in Next.js?

    • A. The request must take exactly 60 seconds
    • B. The cached data can be considered stale after approximately 60 seconds and may be revalidated
    • C. The page is deleted after 60 seconds
    • D. The browser is blocked for 60 seconds
    Show answer

    B. The cached data can be considered stale after approximately 60 seconds and may be revalidated

    A revalidation interval specifies how long cached data can be considered fresh before Next.js can revalidate it.

  9. 9. Which Next.js App Router fetch option requests that data not be cached?

    • A. cache: 'force-cache'
    • B. cache: 'no-store'
    • C. cache: 'static'
    • D. cache: 'build-only'
    Show answer

    B. cache: 'no-store'

    Using cache: 'no-store' tells Next.js not to cache the result of that fetch, making it suitable for request-time data.

  10. 10. Which fetch cache option explicitly requests cached data in the Next.js App Router?

    • A. cache: 'force-cache'
    • B. cache: 'always-cache'
    • C. cache: 'static-cache'
    • D. cache: 'persistent'
    Show answer

    A. cache: 'force-cache'

    cache: 'force-cache' requests that Next.js use a cached response when available and is commonly associated with static or cached data fetching.

  11. 11. Which Next.js feature can be used to revalidate cached data on demand when content changes?

    • A. revalidatePath
    • B. refreshCacheOnly
    • C. clearStatic
    • D. reloadPage
    Show answer

    A. revalidatePath

    revalidatePath can be used to invalidate cached data for a specific route so that the route can be regenerated or refreshed with updated data.

  12. 12. Which function can be used for on-demand revalidation based on a cache tag in the Next.js App Router?

    • A. revalidateTag
    • B. refreshTag
    • C. invalidateCacheTag
    • D. updateTagOnly
    Show answer

    A. revalidateTag

    revalidateTag is used to invalidate cached data associated with a specified cache tag, allowing related data to be revalidated.

  13. 13. Which scenario is a good example of using ISR?

    • A. A product catalog that changes occasionally and should remain fast
    • B. A page containing highly private request-specific information
    • C. A page that must never use cached data
    • D. A form that requires browser-only state
    Show answer

    A. A product catalog that changes occasionally and should remain fast

    ISR can be useful for content such as product catalogs where static performance is desirable but the content needs periodic updates.

  14. 14. What is one key difference between SSR and SSG?

    • A. SSR generally generates HTML at request time, while SSG generates pages ahead of time
    • B. SSR only works in browsers, while SSG only works on mobile devices
    • C. SSG always requires a database, while SSR never can use one
    • D. There is no difference between SSR and SSG
    Show answer

    A. SSR generally generates HTML at request time, while SSG generates pages ahead of time

    SSR is based on request-time server rendering, while SSG produces static pages ahead of requests.

  15. 15. Which statement best describes the relationship between SSG and ISR?

    • A. ISR can extend static generation by allowing generated content to be revalidated and updated
    • B. ISR completely replaces static generation with client-side rendering
    • C. SSG prevents all forms of caching, while ISR enables caching
    • D. SSG and ISR are unrelated rendering concepts
    Show answer

    A. ISR can extend static generation by allowing generated content to be revalidated and updated

    ISR builds on static generation by allowing selected static content to be regenerated or revalidated as data changes.