After I start compressing ob_start (& #039; ob_gzhandler & #039;), I write the content of ob_get_contents to the file, but the content in the file is plain text, the string data is not compressed. Does it mean that this compression process is executed when the S end sends data to the c end? That is, to press the data... after enabling compression ob_start ('ob _ gzhandler'), I write the content of ob_get_contents to the file, but the content in the file is plain text, and the string data is not compressed.
Is this compression process executed when the S end sends data to the c end? That is, after the data is compressed, the http browser is sent to the client, while the local storage process does not enable compression?
If I want to compress the data locally, I can only perform fwrite ($ fp, gzcompress (ob_get_contents?
Reply content:
After enabling compression ob_start ('ob _ gzhandler'), I write the content of ob_get_contents to the file, but the content in the file is plain text, and the string data is not compressed.
Is this compression process executed when the S end sends data to the c end? That is, after the data is compressed, the http browser is sent to the client, while the local storage process does not enable compression?
If I want to compress the data locally, I can only perform fwrite ($ fp, gzcompress (ob_get_contents?
Yes,ob_start('ob_gzhandler')
Is to compress the output cache of the page only, according to the compression method requested by the browser ('gzip ', 'deflate') Corresponding compression back.
The gzcompress compression method is ZLIB, And the gzencode is gzip. Local, you can only gzcompress (ob_get_contents ().
ob
Is the abbreviation of Output Buffer, which is used to manipulate the Output (CGI is the page)
To read and write local compressed files, we recommend that you usezlib://YOUR_FILE_PATH
This method is used to read and write local compressed files (documents). The stream api should reduce the overhead of function call and intermediate memory, and the code is clean, it is also easy to make the configuration decide whether to compress or not, and you can also implement it yourself if necessaryxxx://
I vaguely remember that SAE was playing like this.