# expressjs/compression

Node.js compression middleware

Repository: https://github.com/expressjs/compression
Canonical: https://ross.abutalabs.com/products/compression
Language: JavaScript
License: MIT
License Family: permissive
Topics: compression, javascript, nodejs, expressjs, middleware, gzip, deflate
Last push: 2026-08-05T08:38:37+00:00

## Health v2 (maintenance only)
Score: 69/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 96, release rhythm 16, longevity 100
- inputs: {"age_days": 4627, "days_push": 28, "days_rel": 412, "gap_med": 129.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2807, forks 251 (observed 2026-08-28T04:07:22.863059+00:00)

## What it is
A Node.js middleware library that compresses HTTP response bodies using gzip, deflate, or brotli. It is designed for use with Express and Connect-style middleware stacks.

## Use cases
- compress HTTP responses in an Express app
- serve gzip or brotli-compressed responses based on Accept-Encoding
- reduce bandwidth usage for API responses
- configure compression level and content-type filters
- add response compression middleware to a Connect server

## When to choose
- you use Express or Connect and want drop-in response compression
- you need gzip, deflate, and brotli support with configurable options
- you want a small, well-maintained middleware with sensible defaults

## When to avoid
- you are not using Node.js or an Express/Connect-style middleware stack
- you need static asset pre-compression rather than on-the-fly compression
- responses are already compressed or served by a reverse proxy that handles compression

## Facets
- artifact type: library
- maturity: stable
- function: compression, middleware, http-server
- domain: web-development, backend, performance
- platform: -
- tags: express, gzip, deflate, brotli, http-response-compression, nodejs

## Member repositories
- expressjs/compression (main) score 69

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:22.863059+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:14:27.377607+00:00, confidence not recorded.
  - readme: https://github.com/expressjs/compression (fetched 2026-08-28T04:07:22.863059+00:00, sha b2a4eeb3f566)
  - registry_npm: https://registry.npmjs.org/compression (fetched 2026-08-29T09:54:28.167268+00:00, sha f9be4e8564c4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
