The Gzip function is a way to compress the size of web pages to speed up the speed of opening web pages. Almost all current mainstream browsers support this function. This is a very practical and popular function, but turning on Gzip requires server support. How do you know whether the server where your site is located supports Gzip compression? Ask your space service provider directly? Of course, but is there any other way besides this? Of course there is, and here is a method introduced from a technical perspective.
Create a new php type file, which can be named test.php. Write the following code in the file:
<?php phpinfo(); ?>
Then save and upload it to the root directory of the space you need to test. After uploading, open the URL of this file in the browser:
http://your domain name and directory/test.php, for example, this site is: http://www.phpernote.com/test.php
After opening the page, CTRL+F searches for the following string:
_SERVER["HTTP_ACCEPT_ENCODING"]
After finding it, check to see if there is a gzip parameter at the end. If so, congratulations, your space supports Gzip. If not, unfortunately, it means that your website cannot be compressed by Gzip.
If the server supports the gzip compression function, as for how to implement the gzip compression function on the page, please refer to: How to implement gzip page compression in PHP