Forum: Ruby on Rails mongrel buffers response using streamIO = big problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
C4fd1555c076437dffdfd33a14679246?d=identicon&s=25 Amir Javs (amirj26)
on 2007-02-25 03:05
(Received via mailing list)
I am running a rails app behind Apache2 + Mongrel, and I have a
situation in which I want to use send_file() for downloading of very
large files. However, since mongrel apparently buffers the response
using streamIO before sending it to the client, then clearly send_file
is not a practical means. And it is this situation in which you are to
use the X-Sendfile header instead, to have Apache serve the file
statically. This works fine, if it weren't for an additional
requirement that my rails app needs to know when the download

However using the X-Sendfile header, I won't have any way to know when
the download finishes (AFAIK). So does anyone know either:
1. A way to be able to detect when the download finishes using the X-
Sendfile approach, or
2. A way to get mongrel to not buffer the response using StreamIO, so
that I can use the send_file approach (which, I'm assuming, will allow
me to detect when the download finishes, although I haven't looked
into this yet).

Any ideas would be greatly appreciated.


This topic is locked and can not be replied to.