Sending Content (Message Body) along with 304 Not Modified header

http-headers

For static html pages, when the response header from the server is 304 Not Modified, isn't it the server's responsibility to send back only the headers and not the message-body (html content) along with it ?

Whats the point in sending 304 Not Modified if it comes along with the html content too ?

Best Answer

There is no point to sending a message body with a 304 response. In fact, the HTTP specification says that the server must not do so. If you have one that is, it's misbehaving according to the spec.

From the HTTP Specification:

The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields.