How to make your website faster in easy steps.
How gzip Compression works.
When a request is made by a web browser to your website, Webserver compresses html,css,js,php,txt,pl, etc. and send compress files to users web browser, Then web browser identifies compression and decompress the zip files and displays your website. Which saves bandwidth and l oad website faster.
Enable gzip compression via .htaccess on Apache web servers
The .htaccess file controls many important things for your site.
Create text file and save it with filename .htaccess.
If filename is already present on server then edit and add below rules.
Save the .htaccess file and upload in root directory where your code is present and then refresh your webpage.
How to check If gzip compression is working.
In web browser Press F12 Type your website in url box and press enter. In Chrome Click on "Network" option. In Firefox Click on "Net" option. If not enabled, click enable it. Then Check transferred file size. See the difference before and after adding script.
If Above code seem dint work then remove it from .htaccess and add below code.
Enable compression on NGINX webservers
To enable compression in NGINX you will need to add the following code to your config file.
Was this article Helpful? [ratings]
If you need more help reply in comments.