Enable more HTTP decompression methods for remote cache #27271
Closed
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.
Bazel has support for compressed transfers from/to gRPC remote caches (#14041). However, this is not fully supported for HTTP protocol. This feature would allow to significantly decrease the network traffic for remote cache. The related issue is #23463.
In general, the
HTTPCacheClientclass can decompress the incoming HTTP content because it uses internally theHttpContentDecompressorfrom Netty library. But current implementation allows only "gzip" as acceptable encoding.The version of Netty library used in Bazel has been updated recently to 4.1.110. This version supports much more compression methods than before. The suggested change allows using the new compression options with HTTP remote cache. "Zstd" compression is of particular interest because it is used in popular
bazel-remotesoftware.Note: The suggested change forces the
bazel-remoteto send HTTP content with "zstd" encoding. For compatibility we may consider applying the--remote_cache_compressionoption to enable this functionality. I leaved it as is for now because "gzip" was used unconditionally.