thinkphp v3.1 Development Framework New features: page compression output support

Source: Internet
Author: User
Keywords Development framework new features thinkphp page compression
Tags aliyun browsers configuration development development framework different environment file

Now most browsers have supported the compression output of the page, by compressing the output, the page size can be reduced by 30%, because the 3.0 version does not have the built-in page compression output function, so in general, you need to add in the entry file:

Ob_start (' ob_gzhanhttp://www.aliyun.com/zixun/aggregation/16504.html ' >dler ');

However, because of the different server environment, 8630.html "> Sometimes this configuration conflicts with the zlib compression configuration in the php.ini file. 3.1 New version of the built-in page compression output function, no need to manually add Ob_gzhandler code, add output_encode configuration parameters, and support detection zlib.output_compression.
The frame defaults to the page compression output, and will automatically detect zlib.output_compression configuration, if the php.ini inside Zlib.output_compression is open, the server environment is still the page compression page compression.
The related code is one line:

if (!ini_get (' zlib.output_compression ') && C (' Output_encode ')) Ob_start (' Ob_gzhandler ');

Under individual special circumstances, if you receive an error message similar to the following:

Output_handler "Ob_gzhandler" conflicts with "zlib.output_compression"

Typically because your server is configured with other compression methods that cause conflicts, you can manually turn off Output_encode, that is:

' Output_encode ' =>false

can solve the problem.

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.