Skip to content

Add ETag support middleware to templates #17

Description

@PAMulligan

Description

Add Hono's etag() middleware to the generated project templates for automatic HTTP caching support via ETag headers.

Why

ETags allow clients to make conditional requests, reducing bandwidth and improving performance for frequently-polled endpoints. Hono has a built-in ETag middleware that makes this trivial to include from project creation.

Acceptance Criteria

  • Add etag() middleware to both Cloudflare Workers and Node.js templates in setup-project.sh
  • Import from hono/etag
  • Apply before route handlers
  • CI passes

Implementation

import { etag } from 'hono/etag';

app.use('*', etag());

Metadata

Metadata

Assignees

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions