GZIP compression allows you to compress the resources of a web page before they are served to the users' browsers so that the web page loads faster and thus improves your WPO.
This type of compression has become very popular in recent times among WPO consultants thanks to tools such as Google Page Speed Insights that have given it a lot of importance.
Moreover, this lossless compression format is royalty-free under Open Source license which has facilitated its diffusion.
However, the only downside of this type of compression is that although it is useful (and very useful) for HTML, CSS and JS files, it is not useful for optimising images as it barely compresses them.
In any case, implementing this compression on your website does not mean that it will be optimised in terms of loading speed. GZIP is not a panacea but it will help you a lot to improve the bandwidth consumed by your website when loading.
Why is it good to have GZIP compression activated?
Having GZIP compression enabled on your website will be beneficial because:
- It will compress your files and your website will load very fast.
- It will help Google bots to crawl your website faster and therefore optimise the Crawl Budget.
- All current browsers support GZIP compression.
How does GZIP compression work?
GZIP compression works in a simple way:
The server communicates to the web browser in the URL headers that the content is compressed.
In this way, the browser knows that the files are GZIP compressed and can decompress them before the user sees the content.
Enabling GZIP compression in Apache
To enable GZIP compression in Apache you will have to follow this process:
1. Access via FTP (Filezilla will do) to the .htaccess file on your Apache server.
2. Click on the .htaccess file in the root folder of your server and click on edit.
3. Once you are editing (just open it in a notepad) this file copy the following code to the beginning of the file: