jigglyT101
jigglyT101

Reputation: 984

Testing if gzip is working locally

I've a local wamp setup and installed the deflate_module in apache.

I've also set up the following rule in .htaccess.

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json 

</IfModule>

But how can I test if it's working - how can I tell if the files are being gzipped?

Thanks!

Upvotes: 2

Views: 6228

Answers (2)

hargobind
hargobind

Reputation: 592

I'd also recommend using curl (download here)

The command would be: curl --head --compressed http://yourdomain.com/yourpage.html

That will print the headers from a webpage request. Look for the line that says: Content-Encoding: gzip. If it's not there, then you don't have it configured correctly.

Upvotes: 3

polemon
polemon

Reputation: 4782

use netcat and send an Accept-Encoding: gzip,deflate. If compressed mumbo-jumbo is returned, then your files are gzipped.

Example:

GET / HTTP/1.1
Host: www.yourdomain.org
Accept: text/xml,application/xml,application/xhtml+xml,text/html,text/plain,image/png,image/jpeg,image/gif
Accept-Language: en-us,en
Accept-Encoding: gzip,deflate
Connection: close

Don't forget to add two newlines at the end.

Upvotes: 1

Related Questions