Enable GZip in an .htaccess file

Here is the code to enable gzip in an .htaccess file.
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

Here is a good read on why to use GZIP.

Once enabled you can see the site load improvement here: http://www.whatsmyip.org/http_compression/

View the compression results for this site here.

Leave a Reply

Your email address will not be published. Required fields are marked *