Skip to main content

Module compression

Module compression 

Source
Expand description

Per-message compression and grpc-accept-encoding negotiation.

Zstd uses its frame format, LZ4 uses a single standard frame (without legacy or skippable frames), Gzip uses RFC 1952, Deflate uses the RFC 1950 zlib wrapper, and Snappy uses its raw block format. Compression contexts are independent for each gRPC message.

Structs§

CompressedMessage
Payload bytes and the value of the gRPC frame’s compressed flag.
CompressionConfig
Compression policy for outgoing and incoming messages.

Enums§

CompressionAlgorithm
A supported value of the grpc-encoding header.

Constants§

DEFAULT_MAX_DECODING_MESSAGE_SIZE
Maximum decoded message size accepted by the default configuration.
DEFAULT_MIN_COMPRESS_SIZE_BYTES
Messages smaller than this are sent without compression by default.

Functions§

accept_encoding_header
Formats a comma-separated header, removing duplicate algorithms.
negotiate_compression
Selects the first locally preferred encoding explicitly accepted by a peer. Unknown tokens are ignored; identity is always available as the fallback. An absent header can be represented by an empty string. Parameters and wildcards are not part of the gRPC accept-encoding grammar.