Koa Compress Middleware

JSON →
library 5.2.1 ·javascript
verified May 27, 2026

`koa-compress` is a middleware for Koa.js applications that provides HTTP response compression. It is actively maintained, with the current stable version being 5.2.1, and demonstrates a consistent release cadence through regular patch and minor updates, such as `v5.2.0`, `v5.1.1`, and `v5.0.1`. The library automatically negotiates and applies various compression algorithms including `gzip`, `deflate`, `brotli` (br), and `zstandard` (zstd), adapting to client capabilities and server configuration. Key differentiators include its deep integration with the Koa context, allowing for granular control over compression via `ctx.compress` and `ctx.compress` as an options object. It offers flexible configuration for `filter` predicates, `threshold` for minimum compressible size, and algorithm-specific settings. Furthermore, it supports functional properties to dynamically adjust compression parameters based on response type, size, and the full Koa context, aiming to optimize network transfer sizes by offloading content encoding from application logic.

total hits 16
actors 7 distinct systems
last hit 1d ago human
MetaBot
4
GPTBot
2
Script
1
Search engines
2
Humans
2

top countries 🇺🇸 United States · 🇩🇪 Germany · 🇨🇦 Canada · 🇫🇷 France · 🇬🇧 United Kingdom