How to enable Gzip compression using htaccess

Gzip compression allows reducing file size when transferring from server to user browser. We can enable Gzip compression by writing few lines of code in .htaccess file.

For enabling Gzip compression, we need Apache's mod_deflate module enabled. If it is not already enabled, you can enable using the steps provided here.