ETags — Middleware · Hono

Tag every cat response with etag() so a client that already has it gets 304 and no body, watch the tag change when the cat changes, and pair it with Cache-Control.

What you will learn

Read the theory for ETags

All Middleware lessons

All Hono courses

loading types…

What you'll learn

  • Add etag() on a prefix and read the tag it computes from the body
  • Send If-None-Match back and get 304 with no body and only the retained headers
  • See a change to the resource change its tag, and pair the tag with Cache-Control: max-age