Let clients request gzipped responses from the external API#10341
Open
david-crespo wants to merge 1 commit intomainfrom
Open
Let clients request gzipped responses from the external API#10341david-crespo wants to merge 1 commit intomainfrom
david-crespo wants to merge 1 commit intomainfrom
Conversation
david-crespo
commented
Apr 29, 2026
| HandlerTaskMode::Detached, | ||
| log_headers: vec![], | ||
| compression: dropshot::CompressionConfig::None, | ||
| compression: dropshot::CompressionConfig::Gzip, |
Contributor
Author
There was a problem hiding this comment.
It seems this is the one that matters for production.
david-crespo
commented
Apr 29, 2026
| # concurrently. | ||
| bind_address = "127.0.0.1:0" | ||
| default_request_body_max_bytes = 1048576 | ||
| compression = "gzip" |
Contributor
Author
There was a problem hiding this comment.
I think this turns it on for all tests. Not sure we want to do that, but for the most part it doesn't matter because I don't think requests in tests ask for gzipped responses by default.
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.
Will update with examples of how much smaller the responses are and more detail about what I've tested locally and how we should test this on real systems. In my most recent testing we get about 80% compression on bigger responses. JSON is extremely repetitive.
Changes
Flip
CompressionConfig::None→CompressionConfig::Gzipondropshot_externalinsled-agent/src/services.rs. Internal and lockstep are left as-is for now. oxidecomputer/dropshot#1448 in dropshot 0.17 does all the real work:async-compressionapplication/json,text/*,application/xml, ndjson,+json/+xml)Content-Range, already-encoded responses,text/event-stream, and bodies under 512 bytesAccept-Encoding+ q-value parsingNoCompressionextension markerVary: Accept-Encodingon every compressible response whether or not it was actually compressedThe console asset logic in
nexus/src/external_api/console_api.rsalready serves precompressed.gzfiles withContent-Encoding: gzipset, and dropshot'sshould_compress_responseskips anything with that header, which avoids double-encoding.