Gzip Compressor (proto)
This extension has the qualified name envoy.compression.gzip.compressor
Note
This extension is intended to be robust against untrusted downstream traffic. It assumes that the upstream is trusted.
Tip
This extension extends and can be used with the following extension category:
This extension must be configured with one of the following type URLs:
extensions.compression.gzip.compressor.v3.Gzip
[extensions.compression.gzip.compressor.v3.Gzip proto]
{
"memory_level": {...},
"compression_level": ...,
"compression_strategy": ...,
"window_bits": {...},
"chunk_size": {...}
}
- memory_level
(UInt32Value) Value from 1 to 9 that controls the amount of internal memory used by zlib. Higher values use more memory, but are faster and produce better compression results.
Defaults to
5.
- compression_level
(extensions.compression.gzip.compressor.v3.Gzip.CompressionLevel) A value used for selecting the zlib compression level. This setting will affect speed and amount of compression applied to the content.
BEST_COMPRESSIONprovides higher compression at the cost of higher latency and is equal toCOMPRESSION_LEVEL_9.BEST_SPEEDprovides lower compression with minimum impact on response time, the same asCOMPRESSION_LEVEL_1.DEFAULT_COMPRESSIONprovides an optimal result between speed and compression. According to zlib’s manual, this level gives the same result asCOMPRESSION_LEVEL_6.Defaults to
DEFAULT_COMPRESSION.
- compression_strategy
(extensions.compression.gzip.compressor.v3.Gzip.CompressionStrategy) A value used for selecting the zlib compression strategy which is directly related to the characteristics of the content. Most of the time
DEFAULT_STRATEGYwill be the best choice, though there are situations when changing this parameter might produce better results. For example, run-length encoding (RLE) is typically used when the content is known for having sequences in which the same data occurs many consecutive times. For more information about each strategy, please refer to the zlib manual.Defaults to
DEFAULT_STRATEGY.
- window_bits
(UInt32Value) Value from 9 to 15 that represents the base two logarithmic of the compressor’s window size. Larger window results in better compression at the expense of memory usage. For more details about this parameter, please refer to the zlib manual for
deflateInit2.Defaults to
12, which will produce a 4096 bytes window.
- chunk_size
(UInt32Value) Value for zlib’s next output buffer. See the zlib manual for more details. Also see envoy#8448 for context on this filter’s performance.
Defaults to
4096.
Enum extensions.compression.gzip.compressor.v3.Gzip.CompressionStrategy
[extensions.compression.gzip.compressor.v3.Gzip.CompressionStrategy proto]
All the values of this enumeration translate directly to zlib’s compression strategies. For more information about each strategy, please refer to the zlib manual.
- DEFAULT_STRATEGY
(DEFAULT) Default compression strategy.
- FILTERED
Filtered compression strategy, designed for data produced by a filter or predictor.
- HUFFMAN_ONLY
Huffman-only compression strategy, which uses Huffman encoding only.
- RLE
Run-length encoding (RLE) compression strategy, designed for image data.
- FIXED
Fixed compression strategy, which prevents the use of dynamic Huffman codes.
Enum extensions.compression.gzip.compressor.v3.Gzip.CompressionLevel
[extensions.compression.gzip.compressor.v3.Gzip.CompressionLevel proto]
Compression level values for zlib. Higher levels provide better compression at the cost of increased latency and CPU usage.
- DEFAULT_COMPRESSION
(DEFAULT) Default compression level, equivalent to
COMPRESSION_LEVEL_6.
- BEST_SPEED
Fastest compression with minimal compression ratio, equivalent to
COMPRESSION_LEVEL_1.
- COMPRESSION_LEVEL_1
Compression level 1 (fastest).
- COMPRESSION_LEVEL_2
Compression level 2.
- COMPRESSION_LEVEL_3
Compression level 3.
- COMPRESSION_LEVEL_4
Compression level 4.
- COMPRESSION_LEVEL_5
Compression level 5.
- COMPRESSION_LEVEL_6
Compression level 6.
- COMPRESSION_LEVEL_7
Compression level 7.
- COMPRESSION_LEVEL_8
Compression level 8.
- COMPRESSION_LEVEL_9
Compression level 9 (best compression).
- BEST_COMPRESSION
Best compression ratio with highest latency, equivalent to
COMPRESSION_LEVEL_9.