Enable GZIP Compression
In order for GZIP compression to work, it has to be enabled on the server (ask your webhost), and the necessary rules placed in your .htaccess file, located in the root directory of your site.
How GZIP Compression Works
Once activated, WP Rocket adds GZIP Compression rules in your .htaccess file using the mod_deflate module.
Enabling GZIP on Dedicated Apache Servers
If you run a dedicated Apache server you can activate mod_deflate by executing this command line:
…and restart the server afterwards:
service apache2 restart
When it does not Work
There are two possible causes if GZIP Compression doesn’t take effect.
- You don’t have mod_gzip enabled on your server. Contact your hosting provider and ask them to activate it.
- A plugin, or your theme conflicts by adding its own GZIP compression rules. Deactivate all other plugins, switch to a default theme and check if it works then.
GZIP Compression and NGINX
Nginx doesn’t contain .htaccess. To enable GZIP on NGINX you can follow this guide:
Or you can use this alternate configuration for NGINX provided by one of our customers: