Posts Tagged “rails”

April 17, 2007 at 03:51 AM

Send files faster with X-Sendfile

Rails' send_file has a beautiful, simple interface. Unfortunately, it ties up your Rails process with the rather mundane task of reading a file from disk. If you use Mongrel, you'll quickly notice that the :stream option doesn't seem to make any difference in memory usage and your mongrel process stubbornly doesn't want to let go of that memory once the file has been sent. This is a very, very bad thing. Continued…