ETag Header

Table of Content

The ETag HTTP response header is a mechanism that web servers and browsers use to validate cached components. The ETag (Entity Tag) uniquely identifies a particular version of a resource. It makes web browsing faster by allowing browsers to reuse cached resources when the ETag hasn't changed, thus reducing the amount of data needing to be transferred. It also supports strong and weak validation of cached components, enhancing efficiency, and consistency of websites.

Syntax

ETag: W/"<etag_value>"
ETag: "<etag_value>"

In the header value, 'W/' indicates that the ETag is weak, meaning it does not necessarily ensure byte-by-byte identicalness. The '<etag_value>' represents a version of the specific resource.

Directives

The ETag header does not have defined directives. Rather, it's value either represents the weak or strong entity tag corresponding to the resource.

Examples

ETag: "12345"
ETag: W/"12345"

In the first example, the ETag "12345" signifies a strong entity tag. In the second example, the ETag W/"12345" shows a weak entity tag.

Browser Compatibility

Browser Compatibility
Chrome Supported
Firefox Supported
Safari Supported
Opera Supported
Edge Supported

ETag is a part of HTTP standards and is supported by virtually all modern browsers.

How to modify ETag header

ModHeader is a Chrome extension that allows you to modify HTTP request headers. It can be used to manipulate the ETag header as follows:

  1. Install and open ModHeader.
  2. Click on the '+' button on the right to create a new profile.
  3. In the 'Response headers' section, click the '+' button.
  4. In the 'Name' field, enter 'ETag' and in the 'Value' field, enter the desired ETag value.
  5. Save the profile, it will automatically apply to all HTTP requests made from your browser.

This allows you to test how your application responds to different ETag values, simulate the effect of differing cached component states, and understand the potential effects of ETag manipulation by users or intermediaries.