How to enable mod_deflate for your website

Updated on Sep 7, 2018

Apache 2.0 and newer allow you to compress content before sending it to the visitor's browser. The types of content to be compressed are specified by MIME type. This feature requires Apache's mod_deflate to function correctly.

mod_deflate

FastComet has mod_deflate enabled on all hosting servers so you can optimize your website performance by enabling this feature via your cPanel on every hosting package.

To activate content compression for your website, please login your cPanel and refer to the Software/Service section and click on the Optimize Website icon.

optimize website

On the Optimize Website page you should select the MIME types which will be compressed. Compression is most efficient on text-based files such as html, xml, js and css. Still, you can enable content compression for every file type.

enable compression

Be advised that enabling compression on all file types for a media-rich website including lots of images might result in slightly higher CPU consumption. When you are satisfied with your settings click on the Update Settings button.

Be advised that this tool enabled file compression by adding mod_deflate rules into the .htaccess file located under the public_html directory of your hosting account.

As an alternative method you can enable mod_deflate compression for your website by adding the following lines to your .htaccess file:

 <IfModule mod_deflate.c>

# Restrict compression to these MIME types
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/js
  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
  AddOutputFilterByType DEFLATE image/x-icon

# Level of compression (Highest 9 - Lowest 1)

</IfModule>
On this page...

    cPanel Hosting

    • Free Domain Transfer
    • 24/7 Technical Support
    • Fast SSD Storage
    • Hack-free Protection
    • Free Script Installation
    • Free Website Transfer
    • Free Cloudflare CDN
    • Immediate Activation
    View More