Not Modified
3xx Redirection
Last updated:
The cached copy the client already has is still valid; no body is returned.
Description
Response to a conditional GET (with If-None-Match or If-Modified-Since). Saves bandwidth by telling the client to use its cached representation.
When to use
Return 304 from your cache-friendly endpoints when the requested ETag or Last-Modified is unchanged.
Specification
RFC 9110 §15.4.5
Examples
HTTP response
HTTP/1.1 304 Not Modified Content-Type: application/json Location: /new-url
Node.js (Express)
res.status(304).redirect("/new-url");Go (net/http)
w.WriteHeader(http.StatusNotModified)
Python (Flask)
return jsonify({"error": "Not Modified"}), 304