Watch how ETag and If-None-Match turn a second request into a tiny 304 Not Modified. The difference between a 200 re-download and a cache hit, animated.
Scenario
Requests
3
Current step 9/9
Because the ETag is content-based, cache invalidation is automatic: change the file and the fingerprint changes, so no client keeps stale copies.
Arrow color = status class. The key redirect pair: 301 is 'permanent', 307 'keeps the method'. Notice how cheap the second request is when the cache validates (304).
All status codes
1xx Informational
2xx Success
3xx Redirection
4xx Client error
5xx Server error
HTTP cache validation works on a simple idea: if nothing changed, don't resend the body. The first response carries an ETag — a fingerprint of the content. On the next request the browser sends If-None-Match saying 'here's the fingerprint I have'; if it still matches, the server answers 304 Not Modified with no body at all.
304 lives in the 3xx class — it means 'go to your cache', not 'success'. A few hundred bytes of headers instead of a 142KB stylesheet makes a real difference on slow networks, and combined with CDN caches it slashes origin load.
Last-Modified/If-Modified-Since is the same mechanism based on dates instead of fingerprints. ETag wins on precision — a file whose mtime changed but content didn't still validates. Note that Cache-Control: max-age is even cheaper than 304: while fresh, the browser doesn't send any request at all. HTTP Status Playground