API Fundamentals
/Intermediate
Compression
Definition
A technique used by servers to mathematically shrink the size of an API response payload (HTML, JSON, or text) before sending it over the network, dramatically improving load times.
Explain Like I'm New
JSON text is very repetitive. It might contain the word `"firstName"` 10,000 times. Compression algorithms (like Gzip or Brotli) find those repeating words, replace them with tiny symbols, send the tiny file over the internet, and the browser instantly inflates it back to normal.
Real World Example
A backend tries to send a 2 Megabyte JSON file. The server Gzips it down to 150 Kilobytes. The mobile phone downloads 150 KB instantly on a 3G connection and unzips it.
Common Use Cases
- •Bandwidth saving
- •Mobile API optimization
Interactive Example
Loading...
Console output will appear here...
Interview Questions
basic
- How does the client tell the server that it is capable of unzipping compressed data?
intermediate
- Should you use Gzip compression on JPEG images or MP4 videos before sending them from an API?