Compress the mobile dashboard shell over HTTP #417

Closed
opened 2026-08-09 18:29:50 +00:00 by rockachopa · 0 comments
Member

Problem

The fingerprinted mobile runtime is about 425 KB and the dashboard shell is about 498 KB before icons, but the FastAPI application does not negotiate HTTP compression. The existing bundle test only proves a hypothetical gzip size (about 98 KB for the shell); production still transfers raw bytes. This slows cold launch, service-worker installation, and runtime updates on constrained mobile networks.

Scope

  • Negotiate gzip for substantial dashboard shell responses and JSON payloads.
  • Preserve immutable/no-cache and security headers.
  • Keep identity responses byte-identical and avoid compressing small responses.
  • Verify behavior at the ASGI request boundary rather than only computing build-time gzip size.

Acceptance tests

  • A runtime request with Accept-Encoding: gzip returns Content-Encoding: gzip, Vary: Accept-Encoding, a compressed content length at most 100 KiB, and decompresses exactly to the built runtime.
  • The same runtime with Accept-Encoding: identity is unencoded and byte-identical.
  • Dashboard HTML and CSS are compressed when accepted while retaining their cache and security headers.
  • Small responses are not compressed.
  • The full test suite passes.

No historical issue or recent commit implements wire-level HTTP compression. Issue #379 bundled and fingerprinted the runtime but only added a computed gzip budget; this issue realizes that transfer reduction.

## Problem The fingerprinted mobile runtime is about 425 KB and the dashboard shell is about 498 KB before icons, but the FastAPI application does not negotiate HTTP compression. The existing bundle test only proves a hypothetical gzip size (about 98 KB for the shell); production still transfers raw bytes. This slows cold launch, service-worker installation, and runtime updates on constrained mobile networks. ## Scope - Negotiate gzip for substantial dashboard shell responses and JSON payloads. - Preserve immutable/no-cache and security headers. - Keep identity responses byte-identical and avoid compressing small responses. - Verify behavior at the ASGI request boundary rather than only computing build-time gzip size. ## Acceptance tests - A runtime request with `Accept-Encoding: gzip` returns `Content-Encoding: gzip`, `Vary: Accept-Encoding`, a compressed content length at most 100 KiB, and decompresses exactly to the built runtime. - The same runtime with `Accept-Encoding: identity` is unencoded and byte-identical. - Dashboard HTML and CSS are compressed when accepted while retaining their cache and security headers. - Small responses are not compressed. - The full test suite passes. No historical issue or recent commit implements wire-level HTTP compression. Issue #379 bundled and fingerprinted the runtime but only added a computed gzip budget; this issue realizes that transfer reduction.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
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: stackchain/stackchain-dashboard#417
No description provided.