From Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content:
An origin server MUST NOT send a validator header field (Section 7.2), such as an
ETag
orLast-Modified
field, in a successful response toPUT
unless the request's representation data was saved without any transformation applied to the body (i.e., the resource's new representation data is identical to the representation data received in the PUT request) and the validator field value reflects the new representation. This requirement allows a user agent to know when the representation body it has in memory remains current as a result of thePUT
, thus not in need of being retrieved again from the origin server, and that the new validator(s) received in the response can be used for future conditional requests in order to prevent accidental overwrites (Section 5.2).
I can't fully understand this section... Bolded sentences seem to contradict themselves, don't they?
Note that PUT
is the only verb having a section concerning validator headers (see GET
/POST
/DELETE
/PATCH
).