views:

1979

answers:

2

EDIT I have found that the problem is actually php minify. This was sending the deflated content instead of Apache. I'll find more on this.

According to High Performance Web Sites, if I enable mod_deflate in Apache 2.x, by adding the following line, it should send gzipped/delfated content: -

AddOutputFilterByType DEFLATE text/html text/css application/x-javascript

The book also says that gzip is more effective than deflate.

I have enabled in httpd.conf by adding the same line. But Apache sends Content-Encoding: deflate.

I tested with CURL using: -

curl -i -H "Accept-Encoding: gzip" "http://192.168.1.33/s.js" >> e:\curl_log.txt

It returns 'gzipped' content. But when I send the command: -

curl -i -H "Accept-Encoding: gzip, deflate" "http://192.168.1.33/s.js" >> e:\curl_log.txt

It returns 'deflated' content.

So, if the browser supports both deflated and gzipped, Apache send deflated. How to tell Apache to prefer gzip over deflate?

FYI: -

A: 

See http://httpd.apache.org/docs/2.0/mod/mod_deflate.html for all the gory details -- are you sure you don't have occurrences of no-gzip elsewhere in the configuration? What happens as you vary your "browser", e.g. by using wget with various values for -U?

Alex Martelli
A: 

I suspect whatever you're using to test is not sending ...

Accept-Encoding: gzip

... in the request header.

SpliFF
for a simple test:wget --header="Accept-Encoding: gzip" http://yoursite.com
SpliFF