---
name: "[up-etag]"
area: "API"
kind: "HTML attribute"
parent: "up.fragment module"
url: "https://unpoly.com/api/up-etag"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.fragment module](https://unpoly.com/api/up.fragment.md)</nav>

# [up-etag]

Sets an [ETag](https://en.wikipedia.org/wiki/HTTP_ETag) for the fragment's underlying data.

ETags can be used to skip unnecessary rendering of unchanged content. This is useful for [reloading](https://unpoly.com/api/up.reload.md), [cache revalidation](https://unpoly.com/learn/caching.md#revalidation) and [polling](https://unpoly.com/api/up-poll.md).

<nav aria-label="Guides">

- [Learn: Conditional requests](https://unpoly.com/learn/conditional-requests.md)

</nav>

## How `[up-etag]` attributes are set {#how-up-etag-attributes-are-set}

Unpoly will automatically set an `[up-etag]` attribute when a fragment was rendered from a response with a [`ETag`](https://unpoly.com/api/ETag.md) header. When a fragment was rendered without such a header, Unpoly will set `[up-etag=false]` to indicate that its ETag is unknown.

A large response may contain multiple fragments that are later reloaded individually and should each have their own ETag. In this case the server may also render multiple fragments with each their own `[up-etag]` attribute. See [Individual versions per fragment](https://unpoly.com/learn/conditional-requests.md#fragment-versions) for an example.

---

## Modifying attributes {#attributes}

### up-etag {#up-etag}

(required)

An ETag for the element's underlying data.

You can also set the value to `"false"` to prevent a [`If-None-Match`](https://unpoly.com/api/If-None-Match.md) request header when reloading this fragment.

Type: string

