htmx 4.0 is under construction — migration guide

ETag

Cache identifier for the response content

The ETag response header is a unique identifier for the response content.

htmx stores this value and sends it as If-None-Match on subsequent requests. Return 304 Not Modified when the ETag matches to save bandwidth.

Example

ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4"
return Response( content, headers={'ETag': calculate_etag(content)} )