Activate gzip compression to make your website load faster. When gzip compression is activated, the contents of your website are packaged much like in a ZIP file, reducing the amount of data that needs to be transferred. This allows your website to load faster, particularly with slow Internet connections.
Activating Compression via .htaccess
Create a .htaccess file with the following content. If you already have a .htaccess file, you can supplement the existing file with the following code block.
If you need to replace the "htaccess" file, upload this file to the website directory. Further information is available in the Activate gzip compression (mod_deflate) article.
Activating Compression via php.ini
Alternatively, if you're using PHP you can also activate compression via php.ini. Add the following code to a php.ini file and upload it to your website folder.
The php.ini instructions apply only to the directory where the php.ini file is located. It is best to copy the file to all the directories where PHP files are located.
Further information is available in the Changing php Settings via php.ini article.