HTTP Response encodings and compression HTTP compression


Example

The HTTP message body can be compressed (since HTTP/1.1). Either by the server compresses the request and adds a Content-Encoding header, or by a proxy does and adds a Transfer-Encoding header.

A client may send an Accept-Encoding request header to indicate which encodings it accepts.

The most commonly used encodings are:

  • gzip - deflate algorithm (LZ77) with CRC32 checksum implemented in "gzip" file's compression program (RFC1952)
  • deflate - "zlib" data format (RFC1950), deflate algorithm (hybrid LZ77 and Huffman) with Adler32 checksum