How to enable gzip compression for your sites

When a user hits your website a call is made to your server here to deliver the requested files. The larger the files are, the longer it will take for your webpage to load for your visitors. By enabling gzip compression you’re reducing the size of the files and you’re improving the site speed.

Our servers fully support gzip compression and it’s fairly easy to enable it. Simply add the following lines to your .htaccess:

## Enable gzip compression at HostPapa ##
<IfModule mod_deflate.c>
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
</IfModule>
## End gzip compression ##

After saving these lines in .htaccess please re-test your site(s) and you should see the difference. In addition to gzip compression you can also leverage browser caching as explained in the article here.

If you encounter any problems with this please open a new support ticket from your Dashboard.

Related Articles

Get online with our affordable web hosting

Get online with our affordable web hosting

Learn more now
HostPapa Mustache