How do I enable Gzip Compression for my website?

If you host with Namhost, you can simply contact us and we can assist you in enabling Gzip Compression.

If you want to attempt it yourself, you can try as follows:

Linux Hosting

You will need to add the following lines to your .htaccess file:

     <IfModule mod_deflate.c>
       # Compress HTML, CSS, JavaScript, Text, XML and fonts
       AddOutputFilterByType DEFLATE application/javascript
       AddOutputFilterByType DEFLATE application/rss+xml
       AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
       AddOutputFilterByType DEFLATE application/x-font
       AddOutputFilterByType DEFLATE application/x-font-opentype
       AddOutputFilterByType DEFLATE application/x-font-otf
       AddOutputFilterByType DEFLATE application/x-font-truetype
       AddOutputFilterByType DEFLATE application/x-font-ttf
       AddOutputFilterByType DEFLATE application/x-javascript
       AddOutputFilterByType DEFLATE application/xhtml+xml
       AddOutputFilterByType DEFLATE application/xml
       AddOutputFilterByType DEFLATE font/opentype
       AddOutputFilterByType DEFLATE font/otf
       AddOutputFilterByType DEFLATE font/ttf
       AddOutputFilterByType DEFLATE image/svg+xml
       AddOutputFilterByType DEFLATE image/x-icon
       AddOutputFilterByType DEFLATE text/css
       AddOutputFilterByType DEFLATE text/html
       AddOutputFilterByType DEFLATE text/javascript
       AddOutputFilterByType DEFLATE text/plain
       AddOutputFilterByType DEFLATE text/xml

       # Remove browser bugs (only needed for really old browsers)
       BrowserMatch ^Mozilla/4 gzip-only-text/html
       BrowserMatch ^Mozilla/4\.0[678] no-gzip
       BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
       Header append Vary User-Agent
     </IfModule>

Windows Hosting

If you host with Namhost, you can simply contact us and we can assist you in enabling Gzip Compression. Alternatively, please follow this link for more information on enabling Gzip Compression on IIS.