ericmckean / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Allow preference of gzip over deflate encoding if Accept-Encoding contains both #114

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Minify version: 2.1.2
PHP version: 5.2.9

What steps will reproduce the problem?
1. Load a Minified script in FF.
2. FF accepts both "gzip and deflate"
3. Minify sends deflated encoding.

Expected output:
Send gzip encoded content, to browsers where both gzip and deflate are
accectped. See the stackoverflow link to know why.

Actual output:
See above.

Did any unit tests FAIL? No.

Refer to: -
http://stackoverflow.com/questions/878068/enable-moddeflate-to-send-content-enco
ding-gzip

Original issue reported on code.google.com by ruj.sa...@gmail.com on 19 May 2009 at 7:51

GoogleCodeExporter commented 9 years ago
Minify (like Apache) prefers deflate over gzip (see URL below) and I'll 
probably not 
add an option to change that.

http://stackoverflow.com/questions/878068/enable-moddeflate-to-send-content-enco
ding-
gzip/883258#883258

Original comment by mrclay....@gmail.com on 19 May 2009 at 2:55

GoogleCodeExporter commented 9 years ago
Apache prefers gzip over deflate!
In apache 2.2.9 if you: -
  1)enable mod_deflate
  2)add the line: -
    AddOutputFilterByType DEFLATE text/html text/css application/javascript
Then Apache will gzipped content.

In fact that was the reason, I was asking.

Original comment by ruj.sa...@gmail.com on 19 May 2009 at 3:21

GoogleCodeExporter commented 9 years ago
I see. I've edited my answer on SO. Basically, IMO mod_deflate has confusing 
configuration terms and incomplete documentation w/r/t the actual encodings 
used.

I'd definitely like to know if there is some good reason to prefer gzip, even 
though 
it costs a bit more bandwidth, because I can't find a single major site that 
prefers 
to send deflate-d content to me. :/

Original comment by mrclay....@gmail.com on 19 May 2009 at 4:19

GoogleCodeExporter commented 9 years ago
Let's see if we get any answers:
http://stackoverflow.com/questions/883841/why-do-real-world-servers-prefer-gzip-
over-
deflate-encoding

Original comment by mrclay....@gmail.com on 19 May 2009 at 4:40

GoogleCodeExporter commented 9 years ago
Check the Apache's site itself!
http://httpd.apache.org/docs/2.0/style/css/manual.css

That CSS is included in the page below: -
http://httpd.apache.org/docs/2.0/mod/mod_deflate.html

If you browse that in FF 3, it they are sending gzipped content.

According the book High Performance Web sites, gzip provides 6% more 
compression in
average.

Original comment by ruj.sa...@gmail.com on 19 May 2009 at 5:10

GoogleCodeExporter commented 9 years ago
I understand that mod_deflate under Apache 2.2 prefers gzip, as I mentioned in 
my 
first StackOverflow link. Because Apache does this doesn't mean that Minify 
must.

Gzip does NOT provide more compression than deflate; if the book says or 
implies 
this, it's mistaken. Gzip is always a few bytes (~15 in my testing) larger 
because 
it's a wrapper around deflate.

If I get a very good answer from this question, I'll consider dropping deflate:
http://stackoverflow.com/questions/883841/why-do-real-world-servers-prefer-gzip-
over-
deflate-encoding

Original comment by mrclay....@gmail.com on 19 May 2009 at 7:57