Skip to content

OrderNot attempted

First visit to a prerendered page

Order what happens on a first visit to a prerendered (SSG) React page, from request to interactive.

Drag the rows, or use the arrows, to put them in order from first to last.

  1. The page is interactive; client-only data (e.g. from localStorage) renders on the next pass
  2. React hydrates: renders the same tree, adopts the existing DOM and attaches event handlers
  3. The entry script runs and makes sure the current route's lazy chunks are loaded
  4. CSS, the entry script and the modulepreload-linked chunks download in parallel
  5. The browser parses the HTML: the content is visible but nothing is clickable yet
  6. The browser requests the URL; the CDN edge returns the HTML file (fetching it from the origin on a miss)
Show answer & explanation

Correct order:

  1. The browser requests the URL; the CDN edge returns the HTML file (fetching it from the origin on a miss)
  2. The browser parses the HTML: the content is visible but nothing is clickable yet
  3. CSS, the entry script and the modulepreload-linked chunks download in parallel
  4. The entry script runs and makes sure the current route's lazy chunks are loaded
  5. React hydrates: renders the same tree, adopts the existing DOM and attaches event handlers
  6. The page is interactive; client-only data (e.g. from localStorage) renders on the next pass

Prerendering gives a fast first paint because the HTML already contains the content. Interactivity waits for JavaScript, and hydration must produce the same markup, so browser-only data is applied after it. modulepreload links let the route's chunks download alongside the entry instead of after it.