Categories: Website

Speed up your website with gzip compression

* Note: This article only applies to Linux hosting. On IIS, compression is normally enabled on server level. *

Does your website appear to be loading slow? Speed it up using gzip compress and mod_deflate. You can first verify if your site is already serving compressed content from this link. If it isn’t, add the following code in the .htaccess file under your website folder, save it and then check again for compression. Your site should be loading pages significantly faster now!


### Enable gzip compression for PHP files
php_value output_handler ob_gzhandler

### 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

### End of compression code

Admin

Recent Posts

Enable Outgoing SMTP Server Authentication

All our servers need you to enable outgoing SMTP server authentication to be able to…

4 years ago

Plesk Tutorials – How to configure DNS for a domain in Plesk

Learn how to configure and check your DNS settings in Plesk. After you registered your…

5 years ago

cPanel Tutorials – Force HTTPS Redirect

This video demonstrates how to use the Force HTTPS Redirect feature. This feature allows you…

5 years ago

cPanel Tutorials – MultiPHP Manager

Use cPanel's MultiPHP Manager to manage your domains' PHP version. Being able to manage the…

5 years ago

Email account setup in Outlook 2016

This tutorial will help you to configure Microsoft Outlook 2016 for an email account. Step…

5 years ago

Message Queueing

Generally emails are directly delivered to the destination server. However, if the delivery attempt to…

5 years ago