thinkphp gzip compression is turned on by default
' Output_encode ' = true,//page compression output
The demand is like this
In an action, use the header to output a picture
Problem
Because thinkphp used the Ob_start
The page compression output supports if (C (' Output_encode ')) { $zlib = ini_get (' zlib.output_compression '); if (empty ($zlib)) Ob_start (' Ob_gzhandler '); }
Cause today's problems
if (C (' Output_encode ')) { ob_flush (); Ob_clean (); } $thumburi = ' thumb/666.jpg '; $type = getimagesize ($thumburi); Header ("Content-type:". ) $type [' MIME ']); ReadFile ($thumburi); Die ();
Unable to output the image with the header, all day long, still no solution, who has the insight?
Note: You cannot turn off page compression caching!!
Reply to discussion (solution)
Did you write the third piece of code yourself?
Still turned on the gzip mode pass, then you change the transmission type, not to find the smoke?
And you've opened the gzip? The function of OB is really dizzy, so how do I close this section?
Did you write the third piece of code yourself?
Still turned on the gzip mode pass, then you change the transmission type, not to find the smoke?
And you've opened the gzip? The function of OB is really dizzy, so how do I close this section?
No workaround was found and finally closed the grouped page compression cache.