304
HTTPREDIRECTCommon3xx RedirectionHIGH confidence
Not Modified
Production Risk
Low. A misconfiguration might lead to clients using stale assets or re-downloading fresh assets unnecessarily, but it rarely causes application failure.
What this means
This is used for caching purposes. It tells the client that the response has not been modified, so the client can continue to use the same cached version of the response. The server sends no body with this response.
Why it happens
- 1A browser requests a resource with an 'If-None-Match' or 'If-Modified-Since' header.
- 2The server checks the ETag or last modified date and finds the client's cached version is still current.
- 3This saves bandwidth and reduces server load by avoiding re-sending data the client already has.
How to reproduce
A browser revisits a webpage and asks the server if the site's CSS file has changed since it was last downloaded.
trigger — this will error
trigger — this will error
GET /styles.css HTTP/1.1 Host: example.com If-None-Match: "abcdef12345"
expected output
HTTP/1.1 304 Not Modified
Fix
Configure ETag or Last-Modified Headers
WHEN Serving static or cacheable assets.
Configure ETag or Last-Modified Headers
// Example in Express.js
// Express does this automatically for static files.
app.use(express.static('public'));Why this works
Server Configuration
What not to do
✕
Sources
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev