Output buffering
Posted: Fri Feb 09, 2007 7:06 am
According to
Is "double buffering" needed to accomplish both things or do modern versions of PHP already take this "problem" into account?
Where do I put other headers ? such as:
What would happen if I did this?
the following code is used to "double buffer" when you need to "get content length" and "compress the html" at the same time.
Is "double buffering" needed to accomplish both things or do modern versions of PHP already take this "problem" into account?
Where do I put other headers ? such as:
Code: Select all
header ('Accept-Ranges: bytes');
header('Content-language: en');Code: Select all
ob_start();
ob_start('ob_gzhandler');
... output the page content...
ob_end_flush(); // The ob_gzhandler one
header('Content-Length: '.ob_get_length());
ob_end_flush(); // The main oneCode: Select all
ob_start();
ob_start('ob_gzhandler');
header ('Accept-Ranges: bytes');
header('Content-language: en');
... output the page content...
ob_end_flush(); // The ob_gzhandler one
header('Content-Length: '.ob_get_length());
ob_end_flush(); // The main one