Package com.iizix.jetty
Class CompressionSettings.Zstandard
java.lang.Object
com.iizix.jetty.CompressionSettings.Zstandard
- Enclosing class:
CompressionSettings
Default settings for the Zstandard compression algorithm (
ZstandardCompression).Backed by the zstd-jni native library (bundled inside the jetty-compression-zstandard jar for the major platforms). Supported by Firefox 126+ (2024-05) and Chrome 123+ (2024-03).
Zstandard is generally faster than brotli at comparable compression ratios, and uniquely supports negative "fast" levels for ultra-low-CPU encoding. Defaults below favour ratio.
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intEncoder buffer size in bytes.static intZstandard compression level.Method Summary
Field Details
COMPRESSION_LEVEL
public static volatile int COMPRESSION_LEVELZstandard compression level.Possible values:
-7..-1-- "fast" modes (negative levels), trade ratio for speed1..3-- fast, typical for low-latency HTTP (level 3 is the zstd default)4..9-- balanced10..19-- slower, better ratio20..22-- "ultra" modes, very slow, marginal additional ratio
Default:
22(maximum compression).BUFFER_SIZE
public static volatile int BUFFER_SIZEEncoder buffer size in bytes.Possible values: any positive
int; practical range8192..524288. Zstandard benefits from larger buffers than gzip or brotli, particularly at high compression levels where its window can extend into the megabyte range.Default:
65536(64 KiB).