You’ve probably heard that styles and scripts can have a big impact on site performance. This is certainly true, but these are just pieces of the most fundamental aspect of site performance—the size of your pages.
If you want a faster website, you need smaller pages!
Enabling GZIP compression in your
.htaccess file is one of the easiest ways to decrease your page size and boost your site’s performance.
Here’s what you need to do:
Using an FTP client, edit your
.htaccess file and add the following code after the main WordPress URL rewrite code (the last line should say
# END WordPress):
After adding that code and saving your
.htaccess file, use this tool to check and see if GZIP compression is working.
If the tool says your GZIP is working, you’re done! If not, delete the code you just added, and then try this code instead:
Note: These instructions are for Apache servers. If your site runs on an NGINX server, you’ll need to talk to your host about adding GZIP compression.