KyoMel / Yogyakarta, Indonesia

Term 083083 / 344

Payload Compression

Month
October 2025
Day
9
Source
2025/october-term.md

Definition:

Payload Compression is a technique that reduces the size of data being transmitted over a network by encoding it in a more space-efficient format. It decreases bandwidth usage, speeds up data transfer, and reduces costs, especially important for large datasets, APIs, and web applications.

Key Properties:

  • Size reduction: Compresses data before transmission
  • Automatic handling: Usually transparent to applications
  • Multiple algorithms: gzip, deflate, brotli, etc.
  • Trade-off: CPU time for bandwidth savings
  • Reversible: Original data perfectly reconstructed

How It Works:

  1. Client requests data with compression preference
  2. Server compresses response using specified algorithm
  3. Data transmitted in compressed format
  4. Client decompresses and uses original data

Example:

HTTP Compression Example:

// Client Request
GET /api/users HTTP/1.1
Host: api.example.com
Accept-Encoding: gzip, deflate, br

// Server Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Encoding: gzip
Content-Length: 420
Original-Content-Length: 1247

[compressed binary data]

Keep reading