Gzip compression is a quick and effective way to speed up your page load times, leveraging web browser’s ability to compress and decompress data.
GZip lowers the amount of bandwidth that is needed to transfer your sites files from your hosting service to your site’s users, reducing the time taken to load up your site by a considerable amount.
In most cases, modern web hosting company’s support this feature already, however some configuration is likely required in order to utilize Gzip with your website.
For WordPress based websites, there are a number of different plugins you can use to do this, and we will cover a couple of them below.
WP Super Cache
If you are using WP Super Cache on your WordPress website, Gzip compression can be easily enabled under “Advanced” within your WP Super Cache settings by checking the box next to “Compress pages so they’re served more quickly to visitors” and then clicking on ‘Save’.
For more information configuring this plugin take a look at our KB article, Configure WordPress with WP SuperCache.
W3 Total Cache
If W3 Total Cache is your plugin of choice for your WordPress website, GZip Compression can be enabled within your “Browser Cache” settings which can be found by clicking on the “Performance” tab from your WordPress admin dashboard.
Once on the “Browser Cache” settings page, simply check the box next to “Enable HTTP (gzip) compression” and then save your settings.
You may also be interested to learn more about this plugin in our interview with its creator: W3 Total Cache: Interview with Frederick Townes.
WP Rocket, which is a premium (paid) performance optimization plugin, comes with gZip compression built in and it sets it up when the plugin is activated.
Modifying your .htaccess file. (Advanced users only)
For more advanced users, gZip compression can be activated by adding 30 lines of code to your site’s .htaccess file. This file generally resides within the public_html or www folder on your sites hosting service, dotfiles are generally hidden so you will need to ensure that you can view these if you are using your cPanel’s ‘File Manager’ or ‘FileZilla’.
To show hidden files within cPanel’s File Manager;
1. Once in your ‘File Manager’ within cPnael, click on the settings button (usually at the top right)
2. Check the box beside “Show Hidden Files (dotfiles)”
3. Click “Save”
Once you have found your .htaccess file, you will need to add the following code to it (credit to GTmetrix for the code snippet)
Find out more: read WP Rocket Review: The Professional WordPress Caching Plugin.
Check that Gzip is doing its job
Once set up, you can check your WordPress websites gZip compression status by visiting checkgzipcompression.com, some users have reported that gZip has decreased the bandwidth requirements and page load times by up to 70%, in the test conducted in the screenshot below, we saved almost 60%.