slimphp / Slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
http://slimframework.com
MIT License
11.98k stars 1.95k forks source link

Disable output buffering? #1502

Closed SergeyTsalkov closed 8 years ago

SergeyTsalkov commented 9 years ago

My site needs a page that returns very large amounts of text, on the order of several hundred MB. Slim's output buffering makes this problematic: not only does it use lots of memory, but nothing shows up on the user's screen until the whole page is done building.

I'd really like to disable output buffering so my controller can send the page in pieces as it's built. Is that possible?

designermonkey commented 9 years ago

Which version of Slim are you using?

SergeyTsalkov commented 9 years ago

I'm using Slim 2.6.2, the latest! I guess this is changing with Slim 3 coming out soon?

On Sun, Sep 27, 2015 at 2:47 AM, John Porter notifications@github.com wrote:

Which version of Slim are you using?

— Reply to this email directly or view it on GitHub https://github.com/slimphp/Slim/issues/1502#issuecomment-143533507.

designermonkey commented 9 years ago

I just wanted to verify it so we know :) I'm not sure yet on how to resolve the issue, but we know where to be looking now.

akrabat commented 9 years ago

Yes - you can turn off output buffering on Slim 3, Set the outputBuffering setting to false.

designermonkey commented 9 years ago

Can you do the same on Slim2 though?

geggleto commented 9 years ago

You can flush the buffer.... yourself... http://php.net/manual/en/function.ob-flush.php ... It's a bit of a pain...

akrabat commented 8 years ago

As Slim 3 is released, we are only fixing Security issues on Slim 2.