At present, most browsers have already supported the compression output of the page, by compressing the output, the page size can be reduced by 30%, but since 3.0 and previous versions have no built-in page compression output function, so in general, developers need to add themselves in the entry file:
Ob_start (' Ob_gzhandler ');
However, because of the different server environments, sometimes this configuration conflicts with the zlib compression configuration in the php.ini file. The ThinkPHP3.1 version of the built-in page compression output function, no longer 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 has only 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.