Skip to content

feat: add response compression middleware with gzip and brotli support - #235

Merged
jobbykings merged 1 commit into
Epondia:mainfrom
dahmeezy:feat/response-compression
Jul 24, 2026
Merged

feat: add response compression middleware with gzip and brotli support#235
jobbykings merged 1 commit into
Epondia:mainfrom
dahmeezy:feat/response-compression

Conversation

@dahmeezy

@dahmeezy dahmeezy commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
  • Custom compression middleware using Node.js zlib (brotli + gzip)
  • Brotli preferred when client sends Accept-Encoding: br
  • 1KB compression threshold; skips images/videos/audio
  • Respects x-no-compression response header
  • Tracks compression stats (bytes before/after, ratio, time)
  • Exposes compression stats on /api/health and /health endpoints
  • Adds Vary: Accept-Encoding header to all responses
  • Configurable gzip level (default 6) and brotli quality (default 4)
  • Installs compression npm package as dependency

Closes #124

- Custom compression middleware using Node.js zlib (brotli + gzip)
- Brotli preferred when client sends Accept-Encoding: br
- 1KB compression threshold; skips images/videos/audio
- Respects x-no-compression response header
- Tracks compression stats (bytes before/after, ratio, time)
- Exposes compression stats on /api/health and /health endpoints
- Adds Vary: Accept-Encoding header to all responses
- Configurable gzip level (default 6) and brotli quality (default 4)
- Installs compression npm package as dependency
@jobbykings
jobbykings merged commit 8c5f66b into Epondia:main Jul 24, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Implement gzip/brotli response compression middleware

2 participants