Skip to Content
Senri

ETag

Add an ETag with etag(), and return 304 when nothing changed

import { ,  } from "@senrijs/senri";

const  = ();

.(());
  • It adds a weak ETag to 2xx responses to GET
  • If If-None-Match matches, it returns 304
  • The handler runs every time (the ETag is made from the body)
  • Stream bodies and HEAD get no ETag
  • Register compress() and cache() before etag()

Options

Prop

Type

On this page