Not Modified
ActiveHTTP 304 Not Modified indicates the resource has not been modified since the last request. Defined in RFC 9110 §15.4.5. The client can use its cached copy. Saves bandwidth by avoiding re-downloading unchanged resources.
Description
The 304 Not Modified status code indicates that a conditional GET or HEAD request has been received and would have resulted in a 200 OK response if not for the condition evaluating to false. The server is redirecting the client to use a previously stored representation.
The response MUST NOT contain a message body. It must include headers that would have been sent in a 200 response: Cache-Control, Content-Location, Date, ETag, Expires, and Vary.
This is the foundation of HTTP caching — it allows clients and proxies to validate their cached copies without re-downloading the entire resource.
Examples
GET /style.css HTTP/1.1
Host: example.com
If-None-Match: "abc123"HTTP/1.1 304 Not Modified
ETag: "abc123"
Cache-Control: max-age=3600Edge Cases
- •304 MUST NOT contain a message body.
- •The response must still include headers the client needs to update its cached version (ETag, Cache-Control).
- •If the cached response has expired but the server returns 304, the cache is refreshed without re-downloading.
When You'll See This
- →Browser re-validating cached CSS/JS files
- →CDN checking if origin has updated content
- →API clients polling for changes with If-Modified-Since
Implementation References
| Language | Constant |
|---|---|
| Go | http.StatusNotModified |
| Rust | http::StatusCode::NOT_MODIFIED |
| Python | http.HTTPStatus.NOT_MODIFIED |
| Node.js | http.STATUS_CODES[304] |
| .NET | HttpStatusCode.NotModified |
| Java | HttpURLConnection.HTTP_NOT_MODIFIED |
History
Introduced in HTTP/1.0 (RFC 1945, 1996). Critical for web performance — reduces bandwidth usage by 30-80% for returning visitors.
Related Status Codes
Related Headers
FAQ
How does HTTP 304 caching work?
The client sends If-None-Match (with ETag) or If-Modified-Since. If the resource hasn't changed, the server returns 304 (no body), saving bandwidth.
What is the difference between 304 and 200 with caching?
304 means the server confirmed your cache is still valid. 200 means the server sent the full resource (possibly because your cache expired or you had no cached copy).