API Design · Junior · Question 47 of 75
Why might an API compress responses?
- ✓Correct answer: Gzip or Brotli shrink JSON a lot, reducing transfer time, especially on mobile networks
- 2It makes the server use less CPU
- 3Compression is required by HTTP
Explanation
Clients send Accept-Encoding; servers answer with Content-Encoding. Compression costs CPU, so proxies or CDNs often do it.