# Etags

* ETags, or entity tags, are a mechanism used in HTTP to determine whether a cached resource is still up to date. They are used to validate cached representations of a resource, to avoid unnecessary data transfer.
* An ETag is a unique identifier that is assigned to a specific version of a resource. When a client requests a resource, the server sends back the resource along with its ETag. The client can then cache the resource and store the ETag.
* When the client wants to access the resource again, it sends a request to the server with the ETag it received earlier. The server compares the ETag sent by the client with the current ETag of the resource. If the ETags match, the server sends back a "304 Not Modified" response, indicating that the resource has not been modified and the client can use its cached copy. If the ETags do not match, the server sends back the updated resource and a new ETag.
* ETags are typically generated by the server using a hash function, based on the resource's content and other metadata such as its last modification date. They are often used in conjunction with caching headers such as "Last-Modified" and "Expires" to optimize the performance of web applications.
* It is worth noting that ETags are not guaranteed to be unique for each version of the resource, and it may not be appropriate for all use cases.

## Links

* <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hanfak.gitbook.io/workspace/networks/etags.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
