Serve the app precompressed, compress big JSON answers, bigger list pages (#422) #439

Closed
kayg wants to merge 0 commits from issue/422-compress into dev
Owner

Closes #422.

  • Build: apps/web/scripts/precompress-plugin.ts writes .br (q11) and .gz (-9) next to every text file in dist/, once. The Containerfile build runs it too.
  • Server: precompressed ServeDir/ServeFile by Accept-Encoding, Vary: Accept-Encoding, plain fallback. Caching rules unchanged (immutable for hashed files, no-cache for the page and sw.js).
  • API: tower-http compression (br/gzip level 4) on the request routes only, for answers over 1 KB.
  • Notes list: server cap 500 -> 5000; the app fills the rest in pages of 2000 after the first 500.
  • Perf: home.page_big.

Evidence is on #422.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

Closes #422. - Build: `apps/web/scripts/precompress-plugin.ts` writes `.br` (q11) and `.gz` (-9) next to every text file in `dist/`, once. The Containerfile build runs it too. - Server: precompressed `ServeDir`/`ServeFile` by `Accept-Encoding`, `Vary: Accept-Encoding`, plain fallback. Caching rules unchanged (immutable for hashed files, no-cache for the page and `sw.js`). - API: tower-http compression (br/gzip level 4) on the request routes only, for answers over 1 KB. - Notes list: server cap 500 -> 5000; the app fills the rest in pages of 2000 after the first 500. - Perf: `home.page_big`. Evidence is on #422. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
- Build: a vite plugin writes .br (brotli q11) and .gz (gzip -9) next to every
  text file of dist/, once, so the Containerfile build gets them too.
- Server: ServeDir/ServeFile send the precompressed file that matches
  Accept-Encoding, with Vary: Accept-Encoding; the plain file is the fallback.
  Caching rules (immutable for hashed files, no-cache for the page and sw.js)
  are unchanged and apply to the compressed copy.
- API: tower-http compression (br/gzip level 4) on the request routes only,
  for answers over 1 KB. Never the live socket.
- Notes list: the server accepts pages up to 5000; the app's background fill
  asks for 2000 after the first 500.
- Tests: precompressed serving and the compression layer; the faked deploy in
  pwa-update.spec writes sw.js.br/.gz too; served.spec checks encodings.
- Perf: home.page_big (five pages of 2,000).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Compression level note: measured numbers
Some checks failed
CI / server (pull_request) Successful in 25s
CI / rust (pull_request) Successful in 1m50s
CI / web (pull_request) Failing after 36m39s
db2c62dabb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

Landed in dev via train m.

Landed in dev via train m.
kayg closed this pull request 2026-10-15 16:19:53 +00:00
Some checks failed
CI / server (pull_request) Successful in 25s
CI / rust (pull_request) Successful in 1m50s
CI / web (pull_request) Failing after 36m39s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!439
No description provided.