Description
When a request is received with a If-None-Match header, the ETag comparison must be weak, according to RFC7232 § 3.2: (emphasis original)
A recipient MUST use the weak comparison function when comparing entity-tags for If-None-Match (Section 2.3.2), since weak entity-tags can be used for cache validation even if there have been changes to the representation data.
Earlier § 2.3.2 gives a helpful table for the differences between strong and weak validation:
The example below shows the results for a set of entity-tag pairs and both the weak and strong comparison function results: +--------+--------+-------------------+-----------------+ | ETag 1 | ETag 2 | Strong Comparison | Weak Comparison | +--------+--------+-------------------+-----------------+ | W/"1" | W/"1" | no match | match | | W/"1" | W/"2" | no match | no match | | W/"1" | "1" | no match | match | | "1" | "1" | match | match | +--------+--------+-------------------+-----------------+
CouchDB currently uses strong comparison, even for If-None-Match.
$ curl -vo /dev/null http://couchdb.local/db/document1 -H'If-None-Match:"8FTYH1N3L0TPD7ZEZCPW16J4T"' […snip…] < HTTP/1.1 304 Not Modified < Server: CouchDB/1.6.1 (Erlang OTP/18) < ETag: "8FTYH1N3L0TPD7ZEZCPW16J4T" < Date: Tue, 26 Jan 2016 19:47:46 GMT < Content-Length: 0 $ curl -vo /dev/null http://couchdb.local/db/document1 -H'If-None-Match:W/"8FTYH1N3L0TPD7ZEZCPW16J4T"' […snip…] < HTTP/1.1 200 OK < Vary: Accept < Server: CouchDB/1.6.1 (Erlang OTP/18) < Etag: "8FTYH1N3L0TPD7ZEZCPW16J4T" < Date: Tue, 26 Jan 2016 19:49:25 GMT < Content-Type: application/json < Content-Length: 1449