Why does payload compression trade CPU time for network time, and when is that worth it?
Compressing a response (gzip, brotli) costs CPU cycles on the server and decompression cycles on the client, in exchange for transmitting fewer bytes over the network. This is a clear win when network transfer time dominates the request's total latency — large payloads, slower or higher-latency connections — and a much smaller win, or even a net loss, for tiny payloads where compression overhead exceeds the bytes saved.
Answered in
5 API Performance Techniques That Actually Move the NeedlePagination, async logging, caching, compression, and connection pooling — five concrete techniques that cut API latency without touching business logic.
Read the full analysisOther questions this article answers
More system design & architecture questions
- How much spare capacity should a gateway keep?
- Why are bounded queues important for availability?
- Should a load balancer always move requests away from an unhealthy server?
- Can a circuit breaker prevent every cascading failure?
- Why does pagination improve API performance beyond just 'smaller responses'?
- Why is asynchronous logging faster than writing logs synchronously?
- When does caching actually help API performance, and when doesn't it?
- What specific overhead does connection pooling eliminate?
Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design & Architecture beat.