compression
Enables Pingora’s built-in response compression when present in a filter chain.
On this page
Enables Pingora’s built-in response compression when present in a filter chain.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
level | integer | no | Default compression level for all algorithms. Clamped to each algorithm’s maximum (gzip: 9, brotli: 11, zstd: 22). |
gzip | AlgorithmConfig | no | Gzip algorithm settings. |
gzip.enabled | bool | no | Whether this algorithm is enabled. |
gzip.level | integer | no | Compression level for this algorithm. |
brotli | AlgorithmConfig | no | Brotli algorithm settings. |
brotli.enabled | bool | no | Whether this algorithm is enabled. |
brotli.level | integer | no | Compression level for this algorithm. |
zstd | AlgorithmConfig | no | Zstd algorithm settings. |
zstd.enabled | bool | no | Whether this algorithm is enabled. |
zstd.level | integer | no | Compression level for this algorithm. |
min_size_bytes | integer | no | Minimum body size in bytes; smaller responses skip compression. |
content_types | string[] | no | MIME type prefixes that qualify for compression. |
Example
filter: compression
level: 6 # default level for all algorithms
min_size_bytes: 256 # skip responses smaller than this
gzip:
enabled: true
level: 6
brotli:
enabled: true
level: 4
zstd:
enabled: true
level: 3
content_types:
- "text/"
- "application/json"
- "application/javascript"
- "application/xml"
- "application/wasm"