Edit this page

up.fragment up.fragment.etag(element)
JavaScript function

This feature is experimental. Please share your experiences so we know what to keep or change.

Returns the ETag of the content in the given element.

The ETag corresponds to the ETag header in the response that rendered the fragment. Alternatively the [up-etag] attribute of the element or an ancestor is used.

When the fragment is reloaded, its ETag is sent as an If-None-Match request header. The server may check the header and decide to skip rendering. See Conditional requests for a full example.


Parameters

element Element

Return value

string|undefined

The fragment's ETag.

Return undefined if the fragment was rendered without an ETag.