[cgiapp] Streaming Large Files using PSGI

Mark Stosberg mark at summersault.com
Fri Oct 5 09:03:56 EDT 2012


> This is as far as I've got.  Can anyone help / advise?  Maybe patching
> CAP::Stream is the way to go - I suppose it should be possible to
> detect the running environment and 'do the right thing'.

Mike,

My reading of the spec is that you can return a callback instead of a
body, and the Plack server should handle the rest:

https://metacpan.org/module/PSGI#Delayed-Response-and-Streaming-Body

If the server doesn't suppport streaming, a MiddleWare can provide it:

https://metacpan.org/module/Plack::Middleware::BufferedStreaming

I have not needed to do this yet myself with PSGI (but will eventually).

   Mark


More information about the cgiapp mailing list