Use gzip compression in PHP to give your site a fast access

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

gzip compression Transfer is the content of the Web page in the server compression compression to the client, and the client browser will automatically extract it after the display in your browser. Therefore, it can more effectively save bandwidth flow, in addition to the old version of the browser may not be displayed, but now most browsers can be normal display, so recommend use. You use gzip compression network, we can test.





enabling the gzip transfer requires first PHP4.0.5 later versions.





Method 1:





added
in. htaccess




Php_flag zlib.output_compression on


Php_value zlib.output_compression_level 2








Method 2:





at the beginning of PHP <?php join





Ob_start ("Ob_gzhandler");








these two methods can achieve the compression transmission effect.





so how to gzip compressed HTML?





This is simple: first make HTML into PHP, and then rewrite HTML in. htaccess. This article source: your network http://www.niabc.com/bbs/viewthread.php?tid=23
Related Article

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.