3xx Redirection
HTTP 304 Not Modified
The resource has not been modified since the last request (caching mechanism).
When is 304 used?
- Browser cache validation
- ETag and If-Modified-Since conditional requests
- Reducing bandwidth usage
How to handle a 304 response
Follow the Location header. Most HTTP clients do this automatically, and curl -L follows redirects on the command line. Update links and sitemaps that point at permanently redirected URLs.
Check the status code a URL returns from the command line:
curl -s -o /dev/null -w "%{http_code}\n" https://example.comHow to return 304 from your server
Node.js (Express)
res.sendStatus(304);Python (Flask)
return "", 304Go (net/http)
w.WriteHeader(304)Frequently Asked Questions
What does HTTP 304 mean?
304 Not Modified: The resource has not been modified since the last request (caching mechanism).
Is 304 an error?
No. 304 is in the 3xx Redirection class. Redirection: the client must take additional action, usually requesting a different URL.