What does HTTP status code 304 mean?
The 304 Not Modified status code indicates that the resource has not changed since the last request, so the server is not sending a response body. The client can safely use its cached copy.
When to use it in APIs
Used for HTTP caching. The client sends conditional headers like If-None-Match (containing an ETag) or If-Modified-Since. If the server detects no changes, it returns a 304.
How it compares to other codes
- 200 OK: Returns the full payload, whereas 304 returns no body to conserve bandwidth.