Table of Contents

HTTP - Etag response header (Entity Tag)

About

ETag (Entityt Tag) is a HTTP response header that stores an identifier value for a specific version of the body (ie resource).

A etag comparison should determine whether two representations of a resource are the same and is therefore similar to a hash digest.

Usage

Cache Validation

Used in a conditional request as validator to see if a resource has changed (such as the browser cache is stale and a new resource should be downloaded)

Tracking

An etag can be misused as fingerprints allowing user tracking

For example:

This identification would persist:

Syntax

In BNF:

ETag := ['W/'] '"' 'etag'? '"';

RailRoad:

ETag := ['W/'] '"' 'etag'? '"';

where:

Example

ETag: "xyzzy"
ETag: W/"xyzzy"
ETag: ""

Documentation / Reference