Skip to content

OrderNot attempted

A returning visitor after a deploy

A user who visited last week opens the site again after a deploy. HTML is no-cache; hashed assets are cached for a year. Order what happens.

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

  1. React hydrates with the new code
  2. Unchanged files are found in the cache under their old names; changed ones are downloaded
  3. The browser reads the new hashed file names from the HTML
  4. The ETag no longer matches, so the server responds 200 with the new HTML
  5. The browser sends a conditional request for the HTML (If-None-Match with its stored ETag)
Show answer & explanation

Correct order:

  1. The browser sends a conditional request for the HTML (If-None-Match with its stored ETag)
  2. The ETag no longer matches, so the server responds 200 with the new HTML
  3. The browser reads the new hashed file names from the HTML
  4. Unchanged files are found in the cache under their old names; changed ones are downloaded
  5. React hydrates with the new code

The always-revalidated HTML is how a deploy reaches users. Because names come from content, only files whose contents changed have new URLs, so a returning user downloads just the difference.