Edit this page

up.fragment [up-etag]
HTML selector

Sets an ETag for the fragment's underlying data.

ETags can be used to skip unnecessary rendering of unchanged content. This is useful for reloading, cache revalidation and polling.

Conditional requests

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 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 also render multiple fragments with each their own [up-etag] attribute. See Individual versions per fragment for an example.


Modifying attributes

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 request header when reloading this fragment.

string