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

Every compressed response says Vary: Accept-Encoding: /llms.txt and /sitemap.xml come back br-encoded without it #8328

shipped production is serving it opened this has it
opened this

A shared cache can never hand a brotli body to a client that did not ask for it. On production today, curl -H 'accept-encoding: br' -D - /llms.txt and /sitemap.xml answer content-encoding: br with no Vary header. /.well-known/mcp.json and the hashed CSS carry it.

Done:

  • [ ] Find the layer that encodes text/markdown, text/plain and application/xml. compress in src/http/compress.ts adds Vary only for its TYPES set, which lacks those types. Make every response that is encoded, or could be, carry Vary: Accept-Encoding, once, merged with any existing Vary.
  • [ ] If those types belong in TYPES (llms.txt, robots.txt, sitemap.xml, atom), add them there, so one function owns the rule.
  • [ ] A test requests /llms.txt and /sitemap.xml with and without accept-encoding: br and asserts Vary on both answers, and content-encoding only on the first.

Files: src/http/compress.ts, test/compress*.test.ts (or a new test/vary.test.ts). Risk: keep the security floor's headers intact. Do not double-encode a body that already has content-encoding.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs