What it means
In response to a conditional request (If-None-Match / If-Modified-Since). Send no body - that is the entire point, and the bandwidth saving is why ETags exist.
- Class
- 3xx Redirection
- Defined in
- RFC 9110 §15.4.5
- Cached by default
- No
When you receive a 304
- Nothing is wrong. Your cached copy is current and the browser uses it; DevTools shows the request as 304.
- A 304 for a file you just changed means its validator (
ETagorLast-Modified) did not change with it - look at the build output or the CDN. - The response has no body. The client serves the copy it already holds.
When you send a 304
- Only in reply to a conditional request,
If-None-MatchorIf-Modified-Since, when the resource has not changed. - Repeat the headers you would send with the 200 -
ETag,Cache-Control,Vary- and send no body. - Derive the
ETagfrom the content (a hash or a version number), not from a timestamp that changes on every deploy.
On the wire
HTTP/1.1 304 Not Modified ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4" Cache-Control: max-age=3600