1

The pagespeed tool says

Compressing http://72.10.33.203/workspace/js/plugins.min.js could save 95.0KiB (66% reduction).

but when I test for GZIP it shows that it works.

I have my htaccess and conf files setup correctly (i think).

How can I verify? Is the pagespeed tool wrong? How to I make this work?

Joe
  • 1,775
  • 15
  • 23

2 Answers2

2

See web server response headers using firebug in firefox or developer tools in chrome:

If resource is gzipped you will see header:

Content-Encoding:gzip

You can also use any CLI web clients, e.g. wget:

wget -S -O /dev/null http://72.10.33.203/workspace/js/plugins.min.js 

It doesn't show content-encoding, but if you use

wget --header='Accept-Encoding:gzip,deflate,sdch' -S -O /dev/null` 

Connecting to 72.10.33.203:80... connected.

HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Date: Fri, 18 May 2012 19:51:12 GMT
  Server: Apache
  Last-Modified: Fri, 18 May 2012 19:42:04 GMT
  Accept-Ranges: bytes
  Cache-Control: max-age=31536000
  Expires: Sat, 18 May 2013 19:51:12 GMT
  Vary: Accept-Encoding
  Content-Encoding: gzip   <================================ Look here
  X-Powered-By: PleskLin
  Connection: close
  Transfer-Encoding: chunked
  Content-Type: application/javascript; charset=utf-8
DukeLion
  • 3,259
  • 1
  • 18
  • 19
  • Right, I don't see it on [here](http://see.weareinto.com/GitZ) – Kirk Strobeck May 18 '12 at 19:46
  • 3
    I've tested your url with `wget -S -O /dev/null http://72.10.33.203/workspace/js/plugins.min.js` It doesn't show content-encoding. but when I use `wget --header='Accept-Encoding:gzip,deflate,sdch' -S -O /dev/null http://72.10.33.203/workspace/js/plugins.min.js` content-encoding is set properly and response size is smaller. so, your mod_gzip is set up properly – DukeLion May 18 '12 at 19:53
  • Thank you!! it turns out my company network somehow prevents that header. Thank you! – Kirk Strobeck May 18 '12 at 20:15
  • If you can please edit your answer to reflect the comment, i will award – Kirk Strobeck May 18 '12 at 20:16
  • Well, i thought that was the answer, but even off the network, the google pagetool utility and the headers tools still dont work – Kirk Strobeck May 18 '12 at 20:18
  • Maybe this has something to do with it http://my.opera.com/OmegaJunior/blog/google-chrome-and-gzip – Kirk Strobeck May 18 '12 at 20:20
  • and this too http://stackoverflow.com/questions/962721/pre-compressed-gzip-break-on-chrome-why – Kirk Strobeck May 18 '12 at 20:20
  • sorry, i was incorrect.. this was not the answer. – Kirk Strobeck May 18 '12 at 22:20
  • 1
    @KirkStrobeck Many corporate proxy servers don't support compressed encoding as they'd have to decompress and recompress that content to filter/scan/classify it. – Chris S May 19 '12 at 02:07
0

Add this to .htaccess

<Files *.js.gz>
ForceType text/javascript
Header set Content-Encoding: gzip
</Files>
<Files *.css.gz>
ForceType text/css
Header set Content-Encoding: gzip
</Files>
<Files *.html.gz>
ForceType text/html
Header set Content-Encoding: gzip
</Files>