Class CompressionSettings.Gzip

java.lang.Object
com.iizix.jetty.CompressionSettings.Gzip
Enclosing class:
CompressionSettings

public static final class CompressionSettings.Gzip extends Object
Default settings for the gzip compression algorithm (GzipCompression).

Backed by Deflater. Universally supported by browsers and HTTP clients. Defaults below favour compression ratio over encoding speed.

  • Field Details

    • COMPRESSION_LEVEL

      public static volatile int COMPRESSION_LEVEL
      Deflate compression level.

      Possible values:

      Default: 9 (Deflater.BEST_COMPRESSION).

    • STRATEGY

      public static volatile int STRATEGY
      Deflate compression strategy.

      Possible values:

      Default: Deflater.DEFAULT_STRATEGY (best for general text/HTML/JS/CSS).

    • SYNC_FLUSH

      public static volatile boolean SYNC_FLUSH
      Whether the encoder uses Deflater.SYNC_FLUSH when flushing.

      When true, output is forced to a byte boundary after each write, allowing immediate decoding by the receiver at the cost of a small compression-ratio penalty. Useful for live streaming, harmful for static assets.

      Possible values: false, true.

      Default: false (better ratio).

    • BUFFER_SIZE

      public static volatile int BUFFER_SIZE
      Encoder buffer size in bytes.

      Possible values: any positive int; practical range 4096..262144. Larger buffers slightly improve compression and reduce syscall overhead but use proportionally more memory per active encoding stream.

      Default: 32768 (32 KiB).

    • DEFLATER_POOL_CAPACITY

      public static volatile int DEFLATER_POOL_CAPACITY
      Capacity of the DeflaterPool holding reusable Deflater instances for outbound compression.

      The pool grows on demand up to this cap; deflaters released beyond the cap are closed rather than pooled. A larger cap reduces native- resource churn under high concurrency at the cost of resident memory.

      Possible values:

      • 0 -- no pooling, create a fresh deflater per request (slow, GC churn)
      • positive int -- pool cap (typical: 64..1024)

      Default: 256.

    • INFLATER_POOL_CAPACITY

      public static volatile int INFLATER_POOL_CAPACITY
      Capacity of the InflaterPool holding reusable Inflater instances for inbound decompression (gzipped request bodies).

      Possible values: see DEFLATER_POOL_CAPACITY.

      Default: 128 (lower than deflater cap -- inbound gzipped bodies are rarer than outbound gzip responses for an iiziServer workload).