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?

1

2 Answers 2

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
9
  • Right, I don't see it on here May 18, 2012 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, 2012 at 19:53
  • Thank you!! it turns out my company network somehow prevents that header. Thank you! May 18, 2012 at 20:15
  • If you can please edit your answer to reflect the comment, i will award May 18, 2012 at 20:16
  • 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, 2012 at 2: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>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .