How to know if the server supports Gzip compress _ PHP Tutorial

Source: Internet
Author: User
How do I know whether the server supports Gzip compression. The Gzip function compresses the size of a webpage to accelerate the speed of opening a webpage. Currently, almost all mainstream browsers support this function. This is a very practical and popular function. Gzip is a function that compresses the size of a webpage to accelerate the speed of opening a webpage. Currently, almost all mainstream browsers support this function. This is a very practical and popular feature, but enabling Gzip requires server support. how do I know if my website's server supports Gzip compression? Directly ask your own space service provider? Of course. But is there any other way besides this? Of course there are also some. here we will introduce a method from a technical perspective.

Create a new php file named test. php. write the following code into the file:

 

Save and upload the file to the root directory of the space you want to test. after the file is uploaded, open the URL of the file in the browser:

Http: // your domain name and directory/test. php, such as this site is: http://www.phpernote.com/test.php

After the page is opened, CTRL + F looks for the following strings:
 
_ SERVER ["HTTP_ACCEPT_ENCODING"]
 
Check whether the gzip parameter is available later. if so, congratulations! your space supports Gzip. if not, sorry, this shows that you have used Gzip to compress your website.

If the server supports the gzip compression function, for how to implement the gzip compression function of the page, refer to: how to implement gzip page compression in PHP

Articles you may be interested in
  • Summary of the causes and solutions for slow mysql server query
  • Summarize the causes and solutions for the slow MySQL database server
  • How to view the number of websites on the same server
  • How to optimize servers, static databases, and load balancing for high-traffic websites
  • When CuteFTP is connected to the ftp server, the "invalid parameters" error is displayed.
  • Reasons why PHP adds a backslash before the quotation mark and how PHP removes the backslash, there are three ways to disable the php magic quotation mark
  • Solve the js and css cache problems on linux servers
  • Chrome (Google chrome) does not support form. submit ($ ('form'). submit) solution

Bytes. This is a very practical and popular feature ,...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.