Context
API responses (invoice CSVs, analytics reports, export dumps) can exceed 10MB uncompressed, causing slow downloads and high egress costs.
Current Limitation/Problem
No response compression. Large invoice CSV exports take 30+ seconds to download on mobile connections.
Expected Outcome
Brotli/gzip compression negotiation via Accept-Encoding header, streaming responses for large payloads, and configurable compression level per endpoint.
Acceptance Criteria
Technical Scope
- backend/shared/middleware/compression.ts - compression negotiator middleware
- backend/shared/middleware/streaming.ts - streaming response middleware
- backend/config/ - endpoint-level compression configuration
- backend/gateway/ - API gateway compression config (if separate)
- backend/tests/ - compression integration and performance tests
Context
API responses (invoice CSVs, analytics reports, export dumps) can exceed 10MB uncompressed, causing slow downloads and high egress costs.
Current Limitation/Problem
No response compression. Large invoice CSV exports take 30+ seconds to download on mobile connections.
Expected Outcome
Brotli/gzip compression negotiation via Accept-Encoding header, streaming responses for large payloads, and configurable compression level per endpoint.
Acceptance Criteria
Technical Scope