Edit this page

up.fragment [up-etag]
HTML selector

This feature is experimental. It may be changed or removed in a future version.

Sets an ETag for the fragment's underlying data.

ETags can be used to skip unnecessary rendering of unchanged content.
See Conditional requests for a full example.

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 string

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.