Increase Web Access speed PHP using gzip compression technology

Source: Internet
Author: User
Keywords nbsp; access speed improve transmit

Gzip was first created by Jean-loup Gailly and Mark ahttp://www.aliyun.com/zixun/aggregation/16504.html >dler to file compression for UNIX systems. We often use the file suffix. gz in Linux, which is in gzip format. Today has become a very popular data compression format, or a file format, used on the Internet. The gzip encoding on the HTTP protocol is a technique used to improve the performance of Web applications. Large-volume Web sites often use gzip compression technology to allow users to experience faster speeds.

Gzip compression transfer is the content of the Web page in the server compression compressed 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:

Join 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");


Both of these methods can achieve the effect of compressing transmission.

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

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.