🌍 NextJS · flashcards

NextJS Performance Optimization Flashcards

51 question-and-answer cards covering Performance Optimization as it is examined in NextJS. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.

51Cards in deck
24Free preview
9Syllabus topics
~155Chars per answer
FreePrice

24 sample cards from the Performance Optimization deck

Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.

  1. How do you disable server-side rendering for a dynamically imported component?

    Pass { ssr: false } as the options object: dynamic(() => import('./Comp'), { ssr: false }). The component then only renders on the client.

  2. What does the loading option of next/dynamic do?

    It specifies a component (e.g., a spinner or skeleton) to display while the dynamically imported chunk is being fetched and loaded.

  3. Give a common use case for ssr: false with a dynamic import.

    Loading components that depend on browser-only APIs (like window, document, or a chart/map library that accesses the DOM) which would break during server rendering.

  4. What is lazy loading of components?

    Deferring the loading of a component's code (and rendering) until it is actually needed—such as when it scrolls into view or on user interaction—reducing the initial bundle size.

  5. Which React API underlies lazy loading of components, and what pairs with it?

    React.lazy() for defining the lazy component, paired with <Suspense> to provide a fallback UI while it loads.

  6. How does lazy loading differ from eager loading?

    Eager loading downloads and renders a component immediately on page load; lazy loading defers that work until the component is needed, shrinking the initial payload.

  7. Name a scenario where lazy loading a component is especially beneficial.

    Heavy or below-the-fold components such as modals, tabs not initially shown, comment sections, charts, or video players that aren't needed on first paint.

  8. What is the relationship between dynamic imports and code splitting?

    A dynamic import creates a new code-split chunk; the bundler splits the dynamically imported module into a separate file loaded on demand, so dynamic imports are the mechanism for on-demand code splitting.

  9. What is static file caching in the context of Next.js?

    Storing static assets (images, JS, CSS, fonts) in browser or CDN caches so repeat requests are served without re-downloading from the server, speeding up subsequent loads.

  10. What Cache-Control header does Next.js apply to hashed build assets in the /_next/static folder?

    public, max-age=31536000, immutable — cached for one year and never revalidated, because the filename hash changes when content changes.

  11. Why can files in /_next/static be cached immutably for a year?

    Because their filenames include a content hash; any change produces a new filename, so the cached old file never becomes stale (cache-busting via fingerprinting).

  12. How many seconds is one year of max-age, as used for immutable static assets?

    $31536000$ seconds (that is $365 \times 24 \times 60 \times 60$).

  13. What does the immutable directive in a Cache-Control header tell the browser?

    That the resource will never change during its freshness lifetime, so the browser should not send revalidation requests even on reload.

  14. Where should you place static assets like robots.txt or favicon.ico that must be served at the root path?

    In the public/ directory, whose contents are served from the base URL (e.g., public/favicon.ico → /favicon.ico).

  15. What is a CDN and how does it improve Next.js performance?

    A Content Delivery Network is a network of geographically distributed edge servers that cache and serve static content from a location near the user, reducing latency and offloading the origin server.

  16. How does using a CDN reduce latency for users?

    By serving cached content from an edge server physically closer to the user, shortening the network round-trip distance and time compared to reaching a distant origin server.

  17. When deploying Next.js, which assets are typically served via a CDN automatically?

    The static assets under /_next/static (JS, CSS chunks) and optimized images, which are distributed to edge locations by platforms like Vercel.

  18. What is the difference between a CDN cache and a browser cache?

    A browser cache stores assets on a single user's device; a CDN cache stores assets on shared edge servers benefiting all nearby users, serving them without hitting the origin.

  19. What is server-side caching in Next.js?

    Caching the results of server-rendered pages or data fetches on the server/edge so repeated requests can be served from cache instead of re-rendering or re-fetching, reducing server load and response time.

  20. What is Incremental Static Regeneration (ISR) and how does it relate to server-side caching?

    ISR lets statically generated pages be regenerated in the background after a set interval; the cached page is served until it is revalidated, combining static caching with periodic freshness.

  21. In the Next.js Pages Router, which getStaticProps return value enables ISR revalidation?

    The revalidate property (in seconds), e.g., return { props, revalidate: 60 }, which tells Next.js to regenerate the page at most once every 60 seconds.

  22. In the Next.js App Router fetch API, which option sets the revalidation interval for cached data?

    The next.revalidate option, e.g., fetch(url, { next: { revalidate: 60 } }), caches the response and revalidates it after 60 seconds.

  23. How do you opt a fetch out of server-side caching in the Next.js App Router?

    Set cache: 'no-store' (fetch(url, { cache: 'no-store' })), which makes the request dynamic and fetched fresh on every request.

  24. Compare stale-while-revalidate behavior (as in ISR) to serving a fully dynamic page on every request.

    Stale-while-revalidate serves a fast cached (possibly slightly stale) page instantly while regenerating in the background, whereas a fully dynamic page re-renders on every request—slower but always fresh.

What this deck covers

The Performance Optimization deck follows the NextJS Performance Optimization syllabus — 3 chapters and 9 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 17.0 cards per chapter.

Answers are written to be recallable, not just readable — averaging about 155 characters, which is long enough to carry the reasoning and short enough to say out loud.

A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.

Performance Optimization flashcards FAQ

How many Performance Optimization flashcards are in this NextJS deck?

51 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.

Are these NextJS flashcards free?

Yes. The preview here is free to read with no signup, and the full 51-card deck is free inside the Examius app.

What do the Performance Optimization cards cover?

They follow the NextJS Performance Optimization syllabus — 3 chapters and 9 topics — so the questions track what is actually examinable.

How should I use these flashcards?

Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.