I googled for this problem but there is no answer for it.
I want my PHP script to generate HTTP response in chunked( http://en.wikipedia.org/wiki/Chunked_transfer_en
If the size is big enough, Apache do it for you. If you work with ob_gzhandler, I think it makes no sense. Better you let the buffer out as fast as possible. If PHP really does not send automatically the content-length header or the content-length is from the uncompressed content:
ob_start();
ob_start("ob_gzhandler");
...
ob_end_flush();
header('Content-Length: '.ob_get_length());
ob_end_flush();
You could reduce buffer size with apache's mod_buffer (may be with PHP's ini_set).
PS: If the size is big enough and the content-length is unknown, the content will be send in chunks as a makeshift.