In this article, we will see How to enable gzip compression with NGINX to improve the performance of our web application.
Go to the
First you need to find
and comment on it using Hash(#), like below:
Then adding below code snippets below above code:
Here is a line-by-line explanation of the configuration:
Will Activates gzip compression
instructs proxies to store both the regular and gzipped versions of a resource.
It will Nginx to not compress anything that is lower than the specified size.
This command will instruct to compress data even for clients that are connecting via proxies.
In our case, we’re enabling compression if: a response header includes the “expired”, “no-cache”, “no-store”, “private”, and “Authorization” parameters
Here we can list out the types of files that need to be compressed
Here we are telling Nginx to disable compression for Internet Explorer versions 1-6