On Aug 10, 2007, at 10:20 AM, ry dahl wrote:
> It seems that Merb is sending static files with Mongrel::DirHandler.
> (mongrel_handler.rb:52)
> if get_or_head and @files.can_serve(path_info)
> # File exists as-is so serve it up
> MERB_LOGGER.info("Serving static file: #{path_info}")
> @files.process(request,response)
>
> I haven''t done benchmarks and I''ve hardly glanced at
DirHandler''s code
> but the comment on DirHandler#send_file bothers me:
>
> # Sends the contents of a file back to the user. Not terribly
> efficient since it''s
> # opening and closing the file for each read.
>
> Would it be better for Merb to use X-Sendfile in production mode?
>
> ry
>
Hey Ry-
Merb only sends static files with the dir handler if you are running
it by itself. When it is behind a proxy it doesn''t serve any static
files itself at all.
Cheers-
-- Ezra Zygmuntowicz
-- Founder & Ruby Hacker
-- ez at engineyard.com
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)