Compression is the process of reducing the size of data by encoding it more efficiently. It can be applied to files, network responses, or in-memory structures. Compressed data requires fewer bytes, which improves transfer times and reduces storage usage. Compression algorithms may be lossless—preserving all original information—or lossy, discarding less noticeable details.
Why it matters
Compression speeds up network communication, lowers costs for bandwidth and storage, and improves performance for web applications. Web servers often compress assets before sending them to clients, and many file formats like ZIP and PNG rely heavily on compression.
Examples
HTTP responses can use gzip or Brotli compression to shrink payloads. Image formats like JPEG apply lossy compression to reduce file size. The lesson Content Delivery Networks discusses how CDNs distribute compressed assets globally.