After I turn on the compression ob_start (' Ob_gzhandler '), the contents of the ob_get_contents are written into the file, but the contents of the file are plain text, and the string data is not compressed
Is this compression process performed when the S-side sends data to the C-end? That is, the browser that compresses the data and takes the HTTP to the client, while the local stored procedure does not enable compression?
If I want to compress the data locally, I can only fwrite ($fp, Gzcompress (Ob_get_contents ())).
Reply content:
After I turn on the compression ob_start (' Ob_gzhandler '), the contents of the ob_get_contents are written into the file, but the contents of the file are plain text, and the string data is not compressed
Is this compression process performed when the S-side sends data to the C-end? That is, the browser that compresses the data and takes the HTTP to the client, while the local stored procedure does not enable compression?
If I want to compress the data locally, I can only fwrite ($fp, Gzcompress (Ob_get_contents ())).
The right ob_start('ob_gzhandler')
is to compress only the page's output cache, which is returned according to the compression method requested by the browser (' gzip ', ' deflate ').
The Gzcompress compression method is Zlib,gzencode is gzip. Local words, only gzcompress (Ob_get_contents ())
ob
is the abbreviation for output buffer, which is used to manipulate the outputs (in the case of CGI is the page)
If you want to read and write local compressed files, there are many, I recommend using zlib://YOUR_FILE_PATH
this method to read and write local compressed files (documents), stream form of the API should be able to reduce the function call and intermediate memory overhead, code is clean, but also can easily be configured to determine whether compression or not, You can do it yourself if you need to xxx://
. Remember that SAE is playing like that.