What is Compression?
Compression is a process which decrease the file size and load your website faster to the users. Compression of HTML and CSS files reduce the sixty to seventy percent size of your website and user enjoy the fast loading speed of website in low bandwidth.
Now a days if you does not increase your website speed your competitors will beat you in google competition. Google give more importance to website which loads faster that’s why google has a tool where you can check website speed PageSpeed Insights.
In this google tool you will find some good suggestion to increase your website speed it will let you know how you can enable gzip compression.
How to Enable gzip compression
There are several methods to enable gzip compression.
Here are the some easy steps to enable gzip compression via .htaccess, Apache, Nginx, and Litespeed webservers.
Enable compression via .htaccess
You just need to copy this code and paste in your .htaccess and save.
Enable compression on Apache webservers
If above mentioned code not work in your website there is another method to enable gzp compression. Remove previous code and paste the below mentioned code.
Enable compression on NGINX webservers
To enable gzip on your NGINX server copy and paste this code in your config file.