Compression
Compress responses with zstd, Brotli or gzip, chosen per client. Text such as HTML, JSON, CSS and JavaScript shrinks to 10–30% of its size.
| Type | compress |
| Category | Traffic |
| Requires | Goma Gateway 1.2.0 or newer |
Gateway version
A route using this middleware fails to load on a gateway older than 1.2.0. Miabi does not read the running gateway's version, so nothing stops you saving it — the route is what reports the problem.
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
algorithms | list of text | no | — | Codings offered, in order of preference: zstd, br, gzip. Empty offers all three. Example: zstd. |
minSize | text | no | — | Smaller bodies are sent uncompressed. Bytes (1024) or a size such as 1KiB. Example: 1KiB. |
levels | group | no | — | Levels. |
excludedPaths | list of text | no | — | Never compressed. Exclude pages that show user input next to a secret such as a CSRF token (BREACH). Example: /account/*. |
excludedContentTypes | list of text | no | — | Excluded content types. Example: application/pdf. |
includedContentTypes | list of text | no | — | Replaces the built-in list of text types. Empty keeps the built-in list. Example: text/*. |
upstream | one of passthrough, identity | no | passthrough | passthrough keeps a body the app already compressed. identity asks the app for an uncompressed body, so the gateway does all the compressing. |
levels
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
gzip | number | no | — | 1 (fastest) to 9 (smallest). Example: 5. |
br | number | no | — | 1 to 11. Above 4 costs a lot of gateway CPU for little gain. Example: 2. |
zstd | one of fastest, default, better, best | no | — | zstd. |