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

/contract/openapi.json answers 304 to If-None-Match #6044

shipped production is serving it opened this has it
opened this

Intent: a harness that re-reads the 145 KB OpenAPI document on every start pays for it once per release.

Seen: GET /contract/openapi.json answers 200 public, max-age=300 with no ETag (src/http/mcp.ts:335), so every read rebuilds it (13 ms) and sends it whole.

Done:

  • [ ] the answer carries an ETag derived from the running version and origin, using src/http/etag.ts
  • [ ] If-None-Match with it answers 304 with no body
  • [ ] the document is built once per origin and version, not per request
  • [ ] a test: second request with the ETag is 304; a different version gives a different ETag

Files: src/http/mcp.ts (the route), src/contract/openapi.ts if a cache lives there, one test. Risk: none; this route is touched by nothing else open.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs