Repository navigation
Add optional gzip request compression - #189
Open
turtledreams wants to merge 1 commit into
Open
turtledreams wants to merge 1 commit into
turtledreams wants to merge 1 commit into
Conversation
CI report
Public API changes: Public API, No public API changeNo public API change. For 3079629, updated 2026-11-18 04:14 UTC. Each check's run page has its full log. |
This branch has not been deployed
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.
Adds optional compression of request bodies.
enable_request_compression, off by default.gzip=1. A server that reads compressed bodies answers with"gzip": truenext toc. The SDK keeps that answer in memory for the server URL it came from and never stores it.zlib.gzipon the thread pool and sent to the endpoint with?content_encoding=gzip. A body over 1 MB goes plain, because the server refuses a larger compressed body. The Content-Type staysapplication/x-www-form-urlencodedand no Content-Encoding header is set. A body goes compressed only when it gets smaller. Requests sent as GET (under 2,000 characters withoutforce_post) are unchanged."gzip": true, or when the SDK starts again. Network errors and timeouts do not stop it."gzip": true, so it keeps getting plain requests.gzip=1, plain bodies?content_encoding=gzipas gzip, decodes to the plain body and carries the plain body's checksumgzipkey gets plain bodiesgzipturns compression on againchange_server_url, plain until the new server says gzip"gzip": truecountsTests:
test/tests_request_compression.js(13 tests). The full suite (263 tests) and lint pass.