
RFC-7232 explicitly states that ETags should be content-coding aware, e.g.ĮTag: "123-b" – for Content-Encoding: gzip However, an ETag-generation function could be judged to be "usable", if it can be proven (mathematically) that duplication of ETags would be "acceptably rare", even if it could or would occur. In order to avoid the use of stale cache data, methods used to generate ETags should guarantee (as much as is practical) that each ETag is unique. The method by which ETags are generated has never been specified in the HTTP specification.Ĭommon methods of ETag generation include using a collision-resistant hash function of the resource's content, a hash of the last modification timestamp, or even just a revision number.

The use of ETags in the HTTP header is optional (not mandatory as with some other fields of the HTTP 1.1 header).
