Summary
API responses — especially analytics, transaction history, and agent logs — are returned uncompressed, wasting bandwidth and increasing mobile latency.
Proposed Solution
- Add
compression middleware (already a common Express package)
- Configure threshold: compress responses > 1 KB
- Enable brotli where supported (
Accept-Encoding: br)
- Exclude
/metrics endpoint (Prometheus scraper handles its own format)
- Add
Content-Encoding header verification to smoke tests
Acceptance Criteria
Summary
API responses — especially analytics, transaction history, and agent logs — are returned uncompressed, wasting bandwidth and increasing mobile latency.
Proposed Solution
compressionmiddleware (already a common Express package)Accept-Encoding: br)/metricsendpoint (Prometheus scraper handles its own format)Content-Encodingheader verification to smoke testsAcceptance Criteria
compressionmiddleware applied globally before route handlers/metricsexcluded from compressionContent-Encoding: gzipon large responses