Gzip can compress the size of web pages to accelerate the speed of opening web pages. Almost all current mainstream browsers support this function, but turning on Gzip requires server support. Here we simply use php to determine whether the server supports the Gzip function.
Create a new php type file, which can be named test.php. Write the following code in the file:
Copy code Code As follows:
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://3aj.cn/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 in the back. If so, congratulations, your space supports Gzip. If not, unfortunately, this means that your website cannot use Gzip compression.
http://www.bkjia.com/PHPjc/313578.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/313578.htmlTechArticleGzip can compress the size of web pages to speed up the speed of opening web pages. Almost all current mainstream browsers support this function. But turning on Gzip requires server support. Here we simply...