Why response 304 doesn't have Content-Type header?
304 Not Modified
means that the request contained a conditional header asking the server to respond with the contents of the resource only if the the resource has been modified.
Since no content is being returned, the Content-Type
header is not sent. This is the recommended behavior for a 304 Not Modified
HTTP reply.
From RFC 7232 ยง4.1 :
The server generating a
304
response MUST generate any of the
following header fields that would have been sent in a200 (OK)
response to the same request:Cache-Control
,Content-Location
,Date
,ETag
,Expires
, andVary
.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 anETag
field).
I don't know anything about express.js, but it I would look into what sort of caching is being done.