On 12/21/06, Ezra Zygmuntowicz <[EMAIL PROTECTED]> wrote:
The rails send_file method is not the same thing as setting an X- SendFile header. If you are already using lighttpd for your server then your in good shape. THe rails send_file method actually does read the whole file into memory as it sends it to the client. SO you will see memory problems like you have if you use it on large files. The nice way to do it is to use the X-SendFile header in lighty. In a rails action that just wants to serve a static file from somewhere off the filesystem you can make it look like this:
To be clear, send_file does not read the whole file into memory -- it blows chunks into the output stream. Mongrel and pure-Ruby FastCGI use StringIO to buffer the response before sending it to the client. X-Sendfile is definitely the way to go in any case. jeremy
_______________________________________________ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users