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.
- The browser finds the stored response and sees it is older than 60 seconds, so it is stale
- The browser sends the request with `If-None-Match: "v1"`
- The browser uses the stored body and refreshes its freshness lifetime
- The server compares the ETag and finds the resource unchanged
- The server replies `304 Not Modified` without a body
Difficulty: hard