HTTP ETag
HTTP |
Persistence · Compression · HTTP Secure |
Headers |
ETag · Cookie · Referrer · Location |
Status codes |
301 Moved permanently |
302 Found |
303 See Other |
403 Forbidden |
404 Not Found |
An ETag (entity tag) is part of HTTP, the protocol for the World Wide Web. It is a response header that may be returned by an HTTP/1.1 compliant web server and is used to determine change in content at a given URL. When a new HTTP response contains the same ETag as an older HTTP response, the client can conclude that the content is the same without further downloading. The header is useful for intermediary devices that perform caching, as well as for client web browsers that cache results. One method of generating the ETag is based on the last modified time of the file and the size of the file, another is using a checksum.
To implement the functionality, the server returns the ETag header:
ETag: "686897696a7c876b7e"
If the client wants to retrieve the page again, and it has a cached version, it sends the If-None-Match header with the ETag of the cached page:
If-None-Match: "686897696a7c876b7e"
If the server determines that this matches the current ETag for that page, then the server returns a 304 Not Modified response with no content.
If the ETag is generated incorrectly, it can lead to updated files not being redownloaded by the user agent, or files that are already in the cache being downloaded again.
Tracking use ETags
Many online tracking networks are starting to use ETags as a substitute for HTTP cookies.[citation needed] Cookies are increasingly vulnerable to deletion by privacy aware users.
Because ETags are cached by the browser, and returned with subsequent requests for the same resource, a tracking server can simply repeat any ETag received from the browser to ensure an assigned ETag persists indefinitely (in a similar way to a persistent cookies).
ETags may be flushed by clearing a browser cache (but browser implementations may vary).
References
- ETag in HTTP/1.1 specification
- Apache HTTP Server Documentation - FileETag Directive
- Old SQUID Development projects - ETag support (completed in 2001)
- Concerning Etags and Datestamps by Lars R. Clausen (2004)
- ETag in Lighttpd
See also
- List of HTTP headers (includes example of 'ETag'/'If-None-Match'-headers)
Stub icon | This World Wide Web-related article is a stub. You can help Wikipedia by expanding it. |
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...