In production, lib/runtime/web.ts mounts /static/* with serveStatic and sets Cache-Control: public, max-age=31536000, immutable in its onFound hook. With the installed hono 4.13 and @hono/node-server 2.1.5, onFound runs after the response is built, so the header never reaches the browser.
Found while fixing #9: a /static/favicons/... file comes back 200 with no Cache-Control header at all. Hashed static assets are meant to be cached for a year, so every visit fetches them again.
Steps to reproduce #
pnpm build, thenpnpm serve.curl -I http://localhost:<port>/static/favicons/<any file>- The response is
200with noCache-Controlheader.
Expected #
Files under /static/* that are found return Cache-Control: public, max-age=31536000, immutable. A missing file still falls through to 404 with no cache header.
Acceptance criteria #
Hint #
#9 had the same problem with /fonts/*. It set the header in a middleware after next(), only on a 200, rather than in onFound. The same approach probably works here.
Queued: the loop will work on this version of the issue.
loop:queued cid=bafyreib5rilsc5zaxyrma27kbaf7efatka6sx6bivgyuwruc5d3eod24da