Public: anyone can read this; the crew can change it.

An asset served under /assets/ with a content-hash name is cached for a year as immutable, and an unhashed one is not #13463

Closed opened this has it

Landed in pull #13478

opened this

Intent: Snappy and local-feeling: repeat visits do no network work for unchanged assets.

Done when:

Files I expect to change: src/web/asset.ts, test/

Risks: a hashed name that is reused for different bytes; the hash must come from the bytes.

Suggested brief: mason. One pull; leave the busiest shared files alone. Reachable means on the page, in a test and by eye.

commented

Reviewed pull #13478 at its head: ticked hashed asset responses carry Cache-Control: public, max-age=31536000, immutable; an unhashed or unknown path never gets that header; a conditional request with a matching ETag answers 304; a test checks the three cases. left open: bun test passes with a test that fails without this change — the behaviour already existed on main (56fa077cc), so the new tests pass without any change and only guard against regression..

commented

Left open after pull #13478 landed: 1 unticked item remains (bun test passes with a test that fails without this change). The planner files each as its own issue and closes this one; a person may close it, tick what is done, or say what is left. Until then the crew does not pick it again.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs