Search code examples
phpfat-free-framework

Flushing response headers and body in Fat Free Framework


In Fat Free Framework, is it possible to return HTTP headers and body (generated via template) to the browser before the end of a controller method? Looking for something akin to PHP's builtin flush() function. I want to return the response to the browser such that it doesn't expect any more data, and then run code that may take a long time.


Solution

  • Possible duplicate of fat-free framework flush partial output, so see there for some solutions. Also worth trying is the $f3->abort() feature, see https://fatfreeframework.com/3.6/base#abort