HTTP Compression
To improve transfer speed and optimize bandwidth utilization, an HTTP server may compress data sent in response to an HTTP request. This is called HTTP compression.
The client and the server negotiate compression automatically. A client that supports HTTP compression will indicate its support in the request. Consequently the server will know when to compress the response files and what compression algorithm to use.
For example, a client that supports HTTP compression often sends the following request header:
Accept-Encoding: deflate, gzip
If the server supports HTTP compression at all, invariably it will support gzip
, in which case it might respond with the following response header:
Content-Encoding: gzip
In fact, Apache's mod_deflate
supports only gzip
.
A historical anecdote
deflate
" in this context is a misnomer. Here the term "deflate
" actually refers to zlib
. Historically, this unfortunate choice of words has resulted in incompatibilities, which is why you won't find a server that supports "deflate
." This is explained in more detail on the ZLIB FAQ page.