Skip to content
chriso edited this page Apr 20, 2011 · 5 revisions

Read this article to understand how response chunking works and how it might benefit your app.

To send a string as a chunk

$response->chunk($str);

To flush the contents of the output buffer as a response chunk

$response->chunk();

To render a view and automatically flush the output buffer as a chunk, set the third parameter to true

$response->render('mytemplate.phtml', null, true);

*Note: calling $response->chunk() for the first time sets the appropriate header (Transfer-Encoding: chunked).

Clone this wiki locally