Forum Moderators: coopster
Improvement are about 10% + in loading speed gain
Of course it does not act on img that are already compressed
10% is not a huge gain, however it still is an improvement!
My question is: Is using OB the best way to do it?
And is there any underlying problems that I don’t know about when using GZIP mode?
Note: You cannot use both ob_gzhandler() andzlib.output_compression. Also note that usingzlib.output_compressionis preferred over ob_gzhandler().
function uncompress( $srcFileName, $dstFileName, $fileSize )
{
// getting content of the compressed file
$zp = gzopen( $srcFileName, "r" );
$data = fread ( $zp, $fileSize );
gzclose( $zp );
// writing uncompressed file
$fp = fopen( $dstFileName, "w" );
fwrite( $fp, $data );
fclose( $fp );
}
?>