Overview
| Artifact ID: | a2031eb0a377dbbe393ed26180c8a620a2b3e11c70ef8adf85d3a6f26a2ec38a |
|---|---|
| Ticket: | 50643692665bb464e85d10966b056b2b894674c0
HTTP compression for pages and API, with SSE excluded |
| User & Date: | ai-local on 2026-08-31 11:53:49 |
Changes
- Untracked field cmimetype: "text/x-markdown"
- comment changed to:
Nothing is compressed today. Confirmed against the live forge: identical byte counts with and without Accept-Encoding: gzip, and no Content-Encoding on any response. The only compression in the tree is xfer/container.go (zlib, per the sync RFC) and a gzip reader in registrar.go. Measured savings: timeline 309,584 to 36,599 (88%); ticket list 209,058 to 33,194 (84%); API timeline 30,190 to 7,090 (77%); src/btree.c page 2,335,223 to 196,463 (92%). Benchmarked on the 310KB timeline page: gzip-1 50,688/1.1ms; gzip-6 37,166/3.3ms; gzip-9 36,593/5.1ms; brotli-4 37,725/2.0ms; brotli-5 34,551/3.0ms; brotli-6 33,790/3.5ms; brotli-11 29,973/247ms. Brotli q5 beats gzip-6 on BOTH size (-7%) and time, so there is no tradeoff to weigh; q11 is unusable for dynamic pages but right for static assets compressed once. Honest scope: the forge is reached over Tailscale at 17.3MB/s, where this saves only a few ms. It matters for anyone remote — the btree.c page is 3.7s vs 0.3s at 5Mbps. Brotli needs andybalholm/brotli (no stdlib support); gzip-only is a defensible dependency-free answer at 88% of the benefit. TRAP: web.go has 22 text/event-stream writers. A naive middleware buffers and breaks Datastar streaming. Excluding SSE must be in the first commit, with a test asserting an SSE response carries no Content-Encoding and still flushes per event. Acceptance: HTML and JSON responses negotiate encoding; SSE never compressed and still streams; a test pins both.
- priority changed to: "Medium"
- severity changed to: "Important"
- status changed to: "Open"
- subsystem changed to: "web"
- title changed to:
HTTP compression for pages and API, with SSE excluded
- type changed to: "Feature"