Repository navigation
fix(cli): serve the embedded web UI brotli-compressed - #53645
Merged
Merged
Conversation
Hona
added this pull request to stack #53646
October 7, 2026 01:13
Browsers that accept brotli now get each asset's embedded bytes as they are, with Content-Encoding: br, instead of a body the server decompressed on every request. The HTML stays decoded for its CSP hash, and other clients still get decoded bytes, with Vary: accept-encoding on both.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The server's
HttpMiddleware.compression()already brotli-compresses responses, but for embedded assets that meant two steps on every request: decompress the archive's brotli body, then compress it again at the middleware's level 4. Fonts weren't compressed at all, becausefont/ttfisn't on the middleware's compressible list. Now a browser that acceptsbrgets the archive's quality-11 bytes as they are.flowchart LR subgraph Before A[embedded br q11] -->|decompress| B[raw asset] -->|"compress br q4<br/>(fonts: none)"| C[browser] end subgraph After D[embedded br q11] -->|"Content-Encoding: br"| E[browser] endLoading every web UI asset (1,691 files) from the Windows x64 CLI with
Accept-Encoding: gzip, deflate, br:index.htmlis still sent decoded, because its CSP hashes the inline theme script. The middleware compresses it as before.br, or sendsbr;q=0, still gets decoded bytes. The middleware leaves any response that already has aContent-Encodinguntouched.Vary: accept-encoding.