Last updated July 19, 2019.
If you maintain your own website, you should know about GZip compression. GZip compression is an easy way to speed up your website in under five minutes. I’ll time you. Ready? Go!
What is GZip compression?
GZip compression decreases your website load time, which improves performance and user experience. When your visitor visits a page on your site, the server compresses the page (reducing its size and making it quicker to send) and sends it to the visitor. The file is then decompressed and shown in the visitor’s browser. Your visitor doesn’t need to do anything special and doesn’t see anything different (except for a faster page load time).
Am I using it?
GTmetrix is a great tool that will show you if you have GZip compression enabled. When I ran my site through the checker (before I wrote this post), I saw that it wasn’t enabled.
GTmetrix also tests many other parts of your site, so if you only want to check GZip compression, try the Check GZip compression tool.
How do I enable it?
Editing the .htaccess file
There are several ways to enable GZip compression. Because I host my site at SiteGround, I checked with them first and they recommended adding a few lines to my .htaccess file.
I FTP’d to my site’s files and downloaded the .htaccess file. I opened the file in my text editor, added the lines and replaced the file via FTP.
Another check showed that the change was successful.
Using a plugin
You can also use a plugin like W3 Total Cache, WP Super Cache or WP Fastest Cache to enable GZip compression. Install one of the above plugins and look in the settings for the option to turn it on. Note that these plugins are really robust, so you may want to spend some time looking around to see what else you can enable.
Turning GZip compression is a really quick and low-effort task that will make a big difference on your site.