1. Home
  2. Authoring and Development
  3. Using mod_deflate for Page Compression

Using mod_deflate for Page Compression




What is mod_deflate?

mod_deflate is an Apache module that uses GZIP to compress site files. Compressing your site files can increase the connection speed between the server and visitor’s browsers, thus making pages load faster.

Compressing data before sending the information to the visitor may also reduce bandwidth usage. However, there is no guarantee that page loads will speed up or bandwidth usage will decrease if you use mod_deflate.

What Do You Need to Use mod_deflate?

mod_deflate can only be used on Apache, so it cannot be used on any other type of server. This means, that you can only add mod_deflate on a Shared, VPS, or Dedicated accounts. WP Enthusiast and WP Professional accounts use Nginx and so cannot use the mod_deflate module.

How to Compress Pages with mod_deflate

If your website uses WordPress, you should use zlib compression instead of mod_deflate. Read more about zlib compression here: Using zlib for Page Compression.

You can add the mod_deflate module to your server by adding a line of code to your site’s .htaccess file. For information about accessing your .htaccess file, see our article Accessing Your .htaccess File.

AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript

Copy this code at the end of your .htaccess and save the file.

How to Check if it’s Working

There are sites where you can check to see if a site is being compressed or not. One such site is https://sitechecker.pro/gzip-test/. You can enter the site address and the site will check to see if your site has been compressed.

Updated on February 3, 2023

Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support