My readings of the applicable RFCs (2616, 1950, 1951, and 1952) indicate
that you can’t just “strip” the header off a proper RFC-compliant gzip
stream and call it “deflate”. The “gzip” compression is a RFC 1952 gzip
stream which may contain one or more members. The “deflate” compression
an RFC 1950 zlib + RFC 1951 deflate stream, which differs from a “raw”
1951 DEFLATE stream.
I realize that many popular web servers simply send a RFC 1951 stream,
in my opinion, if it’s added to nginx, it ought to be done right.
not looked at the relevant code yet, but getting a zlib stream instead
gzip stream should be easy enough, in the end.
Also, due to the fact that a zlib stream is “simpler” than a gzip
many implementations of zlib are actually faster (though potentially a
bit larger in terms of total data). So, instead of a separate
directive, I’d like to see it implemented as “always on” (in case a User
Agent only requests deflate for some reason). Then the gzip directive
be modified to have 3 options: Off; On (same as ‘prefer_gzip’); and
‘prefer_deflate’ (for those sites which prefer the efficiency over the
potential < 10% bandwidth savings). Potentially, there could also be a
‘never_deflate’ option to the gzip directive. Honestly, I can’t see a
reason for this, myself.
By changing the gzip directive, any upgrading sites would
get the new feature while allowing sites to fine-tune their outgoing
content. And all without yet-another-directive. And it could be
akin to gzip_proxied:
syntax: gzip off|prefer_gzip|prefer_deflate|on
default: gzip off
context: http, server, location, if (x) location
Enables or disables gzip compression.
- off - disables compression for all requests
- prefer_gzip - sends gzip content to user agents who can accept both
gzip and deflate content
- prefer_deflate - sends deflate content to user agents who can
both gzip and deflate content
- on - synonym for “prefer_gzip”. For backwards-compatibility with
But count this as a message in support of the feature (else I would not
bothered typing so much). I’d just like to see it implemented in a way
is as useful as possible, and without mimicing “other” web servers’
From: “Paul G.” email@example.com
Date: Monday, December 29, 2008 6:13 PM
Subject: about add deflate support to http_gzip_filter_module