CS Fundamentals Trainer · JavaScript · Performance & Memory
An HTML document is served with Cache-Control: no-cache and an ETag. What does the browser do on the next visit?
An HTML document is served with `Cache-Control: no-cache` and an `ETag`. What does the browser do on the next visit?
- It doesn't store the response, so the document is downloaded in full on each visit.
- It reuses the stored copy without contacting the server until the ETag expires.
- It stores the response but revalidates with `If-None-Match` before each reuse, and a `304` lets it reuse the stored copy.
- It reuses the stored copy for the rest of the session and revalidates after the tab is closed.
Difficulty: hard