Gzip compression helps the server to load websites faster.
Therefore, it’s a standard practice to enable gzip compression in web servers.
That’s why, we often get requests from our clients to “enable gzip compression” on the server as part of our Server Management Services.
Today, we’ll see how the Technical Support Engineers help our clients to “enable gzip compression on Plesk” and fix typical errors related to it.
Why we need gzip compression?
First, let’s see why we need gzip compression.
Gzip (GNU zip) is a free and open source program for file compression. It is a method of compressing files for faster network transfers.
It is most often used to compress web pages at the server side. And, it provide benefits like,
- -> reduce the size of data.
- -> save storage space.
- -> increase the data transfer rate.
- -> compress online streaming media (video audio content).
Thus, our Dedicated Engineers always enable compression as part of making websites load faster.
How gzip compression works?
Let’s see how compression works when you request a file. It take 5 major steps in the process.
1.When a server receives a request for a web page, the server checks if the browser supports gzip.
2. If so, the server generates the markup for the page before applying gzip.
3. Gzip converts the markup into a compressed data stream which is then delivered to the user.
4. When the user receives the compressed data, their browser decompresses it.
5. Now the user can view the requested file without any delay.
Now, it’s time to discuss how to “enable gzip compression on Plesk”.
Steps to enable gzip compression
Let’s begin on how our Support Engineers enable gzip compression in Plesk server for a domain.
1. In Plesk, go to Domains > yourdomain.com > Apache & Nginx Settings.
2. We add the following directives to the Additional Nginx directives field:
3. Click Ok.
Now, we can view the changes from the phpinfo() page under the domain. It will show a section of Gzip module too.
Things that go wrong with Plesk gzip compression
However, while dealing with Plesk servers, our Technical Team often find related errors regarding Gzip.
Even though after enabling gzip compression in Plesk, at times they approach us with the error “gzip not working“. Let’s check the steps that we do to fix them.
1. Errors in settings
1. Initially, we ensure that the server has Gzip module support in Plesk server. However, in the web servers like Nginx, gzip compression will be enabled automatically after installation with its default settings.
2. Next, we check the content of the configuration file.
Here is the content of /etc/nginx/conf.d/gzip.conf file in server having problems.
2. From that, we could identify the entry “gzip off“. So, to fix, we enabled it.
3. Also, our Dedicated Engineers test the Nginx syntax prior to the web server restart. If it is ok then it shows the following:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
After the restart, website compression started working fine.
2. Gzip settings for static files
1. The second issue that our client reported was “gzip does not work for static files” on Plesk Onyx versions.
2. So, to fix the problem on Plesk Onyx, we added the following settings in the Additional Nginx directives of their website.
3. Thus, the problem was solved and the customers gzip compression worked correctly.
[Have slow websites? We can enable Gzip compression to make websites faster.]
In short, as demand for information increases, techniques for quickly and efficiently delivering large amounts of data becomes more relevant. Gzip compression can add a profitable speed boost to any web service. Today, we saw how our Support Engineers enable “gzip compression on Plesk” and fix errors with it.