The Chillidog Software Blog

The ramblings of a developer

Let's do the Gzip shuffle

At Chillidog Hosting, we developed a free site treat to help users build better websites. With the treat in hand, we'd like to help you implement these site improvements. Let's get to work and do the Gzip shuffle!

What is GZip?

Gzip is a compression technology much like the .zip files you use every day. Many modern browsers have the ability to request a Gzip compressed (smaller) version of your website and decompress it once, on the fly, it is fully loaded.

What is the benefits of GZip?

Having a Gzip'ed website greatly speeds up your site. Just take a look at our test page. This is especially important on mobile devices such as iPhones and Android devices where the internet connection can be slow and intermittent.

How do I enable GZip on my site?

GZip can be enabled by adding some simple code to your site's .htaccess file.

What is a .htaccess file?

A .htaccess file is a special file used by web servers to modify the host settings on the fly. This file should be in the document root of your site (where your homepage is). Please note that this file is typically hidden by most FTP applications and file managers.

Enabling Show Invisible/Hidden items in FTP applications

What code should I put in my .htaccess file to enable GZip?

We recommend the following code. This will automatically compress your CSS, JS, HTML, XML and other text files automatically.

<IfModule mod_deflate.c>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
        AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
    <IfModule mod_mime.c>
        # DEFLATE by extension
        AddOutputFilter DEFLATE js css htm html xml
    </IfModule>
</IfModule>

How do I test to see if my site is GZip'ed?

Aside from our free site treat, you may also use this site as a second resource to verify that it is working.

Of course, if you're a Chillidog Hosting customer, we automatically set up and configure Gzip for you automatically. There is nothing that you need to do. We wanted to save you time, energy, and headache of having to set this up yourself so we did it for you. :)

Your top dog, Greg