CS Fundamentals Trainer · JavaScript · Performance & Memory

A script was cached with Cache-Control: max-age=60 and ETag: "v1". Five minutes later the page requests it again and the file is…

A script was cached with `Cache-Control: max-age=60` and `ETag: "v1"`. Five minutes later the page requests it again and the file is unchanged. Put the steps in order, first to last.

  1. The browser finds the stored response and sees it is older than 60 seconds, so it is stale
  2. The browser sends the request with `If-None-Match: "v1"`
  3. The browser uses the stored body and refreshes its freshness lifetime
  4. The server compares the ETag and finds the resource unchanged
  5. The server replies `304 Not Modified` without a body

Difficulty: hard

Answer this question

Related questions