Node.js Compression Middleware
JSON →compression is a Node.js middleware designed for efficient HTTP response body compression, primarily utilized within web frameworks like Express.js. It supports multiple compression encodings, including deflate, gzip, and brotli, automatically negotiating the most suitable option with the client's `Accept-Encoding` header. The current stable version, 1.8.4, is actively maintained by the Express.js organization, receiving regular updates for security, dependency management, and minor improvements. Its release cadence is driven by the broader Express.js ecosystem's needs. Key differentiators include its simple API for integration into existing Express applications, extensive configuration options that leverage Node.js's native `zlib` module settings for granular control over compression levels and memory usage, and a flexible filter mechanism to conditionally apply compression based on request and response characteristics. It stands out for its robust handling of HTTP headers like `Cache-Control` to prevent unwanted transformations.
Traffic · last 30 days ↓14% vs prev 7d
top countries 🇸🇬 Singapore · 🇺🇸 United States · 🇩🇪 Germany · VN · BD