Bug 53121 - Confusing documentation, gzip and deflate
Summary: Confusing documentation, gzip and deflate
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 2.2.22
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: HTTP Server Documentation List
Depends on:
Reported: 2012-04-22 05:30 UTC by Ryan4
Modified: 2016-01-12 16:17 UTC (History)
0 users

mod_deflate doc patch (1.67 KB, patch)
2015-12-28 14:08 UTC, Luca Toscano
Details | Diff
Amended explanation about gzip vs deflate (986 bytes, patch)
2016-01-02 10:32 UTC, Luca Toscano
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan4 2012-04-22 05:30:54 UTC
The module is actually using gzip no matter what client request, so the documentation should warn at the top of documentation, state clearly that this module only output "gzip", no actual deflate is ever supported.


Added in config: 

AddOutputFilterByType DEFLATE text/html text/plain text/xml


curl -I -H  'Accept-Encoding: gzip' http://www.example.com
Content-Encoding: gzip

curl -I -H  'Accept-Encoding: deflate' http://www.example.com
Content-Encoding: gzip

So, no actual deflate is ever supported.
Comment 1 Eric Covener 2012-04-22 11:29:19 UTC
some background:


 What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?
"gzip" is the gzip format, and "deflate" is the zlib format. They should probably have called the second one "zlib" instead to avoid confusion with the raw deflate compressed data format. While the HTTP 1.1 RFC 2616 correctly points to the zlib specification in RFC 1950 for the "deflate" transfer encoding, there have been reports of servers and browsers that incorrectly produce or expect raw deflate data per the deflate specficiation in RFC 1951, most notably Microsoft. So even though the "deflate" transfer encoding using the zlib format would be the more efficient approach (and in fact exactly what the zlib format was designed for), using the "gzip" transfer encoding is probably more reliable due to an unfortunate choice of name on the part of the HTTP 1.1 authors.
Bottom line: use the gzip format for HTTP 1.1 encoding.
Comment 2 Wim Lewis 2014-03-25 21:42:27 UTC
Can confirm that mod_deflate in Apache 2.4 never uses the deflate encoding, only the gzip encoding.

(As Eric Covener says they use the same actual algorithm, also called "deflate", but the "gzip" and "deflate" content-encodings have slightly different headers.)
Comment 3 Luca Toscano 2015-12-28 14:08:14 UTC
Created attachment 33380 [details]
mod_deflate doc patch
Comment 4 Luca Toscano 2016-01-02 10:32:26 UTC
Created attachment 33393 [details]
Amended explanation about gzip vs deflate

After a chat with Humbedooh on #httpd-dev I revised my last patch with something more formal.
Comment 5 Luca Toscano 2016-01-02 10:35:12 UTC
Interesting note from Humbedooh: 


The discussion about gzip vs deflate was done a while ago, it might be good to re-think about it since it is 2016 and super old browsers should not be a problem anymore.
Comment 6 Takashi Sato 2016-01-10 07:17:30 UTC
The patch is helpful. +1
Comment 7 Rich Bowen 2016-01-12 16:17:20 UTC

Applied to trunk in r1724273.
Applied to 2.4 in r1724274.