Open In App

HTTP headers | ETag

ETag or Entity Tag is a response-type header that works as a validator to let client make conditional requests. It makes re-validation requests more efficient by triggering request headers which help with web cache validation that makes economical use of network bandwidth. 

ETag is generated as identification for specific browser resources. Each time the user opens the same resource, the browser sends a small token to verify if this version of the resource already present in the browser’s HTTP cache matches with the current version on the webserver. If the resource matches then web server need not send a full response. This makes process faster and saves data. 



Syntax:

ETag : "etag-value"   (strong validation)
ETag : W/"etag-value"  (weak validation)   

Directives : This header accepts two directive as mentioned above and described below:



Working of ETag with Request Headers : 

ETag : "21e92a357b3434b5aa"
If-Match : "21e92a357b3434b5aa"
If-None-Match : "21e92a357b3434b5aa"

Examples : 

ETag: "21e92a357b3434b5aa"  (strong validation)
ETag: W/"21e92a457b3434b5aa"  (weak validation)

Supported Browsers : The browsers are supported by HTTP header | ETag header are listed below:

Article Tags :