Overview

Nothing has changed since your last request, there is no need to retransmit the requested resources.

Note

Many developer tools' network panels of browsers create extraneous requests leading to 304 responses, so that access to the local cache is visible to developers.

Takeaways

  1. A conditional GET or HEAD request has been received and would have resulted in a 200 OK response if it were not for the fact that the condition evaluated to false.
  2. There is no need for the server to transfer a representation of the target resource because the request indicates that the client, which made the request conditional, already has a valid representation.
  3. The server is therefore redirecting the client to make use of that stored representation as if it were the payload of a 200 OK.
  4. The server generating a 304 response must generate any of the following header fields that would have been sent in a 200 OK response to the same request: Cache-Control, Content-Location, Date, ETag, Expires, and Vary.

Since the goal of a 304 response is to minimize information transfer when the recipient already has one or more cached representations, a sender should not generate representation metadata other than the above listed fields unless said metadata exists for the purpose of guiding cache updates (e.g., Last-Modified might be useful if the response does not have an ETag field).

If the conditional request originated with an outbound client, such as a user agent with its own cache sending a conditional GET to a shared proxy, then the proxy should forward the 304 response to that client.

A 304 response cannot contain a message-body; it is always terminated by the first empty line after the header fields.

Information

The 304 Not Modified client redirection response code indicates that there is no need to retransmit the requested resources. It is an implicit redirection to a cached resource. This happens when the request method is a safe method, such as GET or HEAD, or when the request is conditional and uses an If-None-Match or an If-Modified-Sinceheader.

The equivalent 200 OK response would have included the headers Cache-Control, Content-Location, Date, ETag, Expires, and Vary.

Related

Further Reading

Specification

304 Not Modified | The HTTP Working Group

304 Not Modified

MDN web docs

Safe (HTTP Methods)

MDN web docs

If-None-Match header field

MDN web docs

If-Modified-Since header field

MDN web docs

Cache-Control header field

MDN web docs

Content-Location header field

MDN web docs

Date header field

MDN web docs

ETag header field

MDN web docs

Expires header field

MDN web docs

Vary header field

MDN web docs