Hello Trevor,

Web servers (e.g.: Apache) is tuned for serving up static files.
Ruby (e.g.: mongrel) is not as efficient at serving up static files.

But sometimes, your ruby code generates a file that needs to be streamed. Or it 
uses logic to determine the name of an existing file that needs to be streamed.

So there is a mechanism for ruby to set a header (X-sendfile), asking apache to 
stream the file for it.

This is nice:
a) A mongrel is not held up
b) c code can stream a file better than ruby.
c) web servers are often tuned to use OS level calls, zero copy streaming, and 
stuff. Have them maintain that configuration.

I think lighttpd introduced the flag, but I digress.


You run into a problem when the static file is not on the filesystem of the 
apache server.
E.g.: Apache is on one server and a mongrel is running on a separate machine.

So you need to tell rails to not use the handy X-sendfile header and stream the 
file through.


How this affects Heroku?

The web server is running on a different machine than the dynos. So X-sendfile 
doesn't work.
So they modify your environments/production.rb to disable that feature.

But this tweaking takes a few seconds during slug generation, and they are 
tweaking your configuration. So they give you a warning to let you know.


At least, that is my take,
Keenan


On Mar 21, 2011, at 7:45 AM, Trevor Turk wrote:

> I have:
> 
> config.serve_static_assets = true
> 
> ...but I don't have anything with:
> 
> config.action_dispatch.x_sendfile_header
> 
> ...at all. Perhaps you are doing something unnecessarily in my case? You can 
> view my app "teamlab" yourself on Heroku if you like. I can file a support 
> ticket if necessarily. 
> 
> Also, you didn't answer my first question: "what is this about" ? :)
> 
> Thanks,
> - Trevor
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Heroku" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/heroku?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to