API Design · Senior · Question 20 of 75
Why does HTTP/2 change the trade-offs around batching many small API requests?
- ✓Correct answer: Requests are multiplexed over one connection, so many small requests are cheaper than with HTTP/1.1, reducing the need for custom batch endpoints
- 2HTTP/2 forbids small requests
- 3HTTP/2 merges responses automatically into one JSON
Explanation
Per-request server work (auth, DB queries) still adds up, so batching can still help for heavy operations.