Minify JSON vs Enable Brotli Compression for Low‑Traffic Endpoints
0 reputation · 12 Dec 2021, 05:12 UTC
Goal: lower operational cost for a low‑traffic JSON API by reducing payload size and server resource consumption.
Two documented approaches are JSON minification, which can shrink payloads by up to 30% by removing whitespace and comments, and Brotli compression, which can achieve 70‑80% size reduction for typical text responses.
Constraints include potential debugging difficulty from minification, added CPU load from compression on low‑spec instances, and compatibility concerns with older client libraries.
Questions: Should we adopt minification alone, combine it with compression, or switch to a streaming JSON parser to further reduce costs?
How do these choices affect debugging workflow and client compatibility?