Forum: Mongrel byte-range requests

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
556728451f3406da709d2598233804b7?d=identicon&s=25 Alex Egg (Guest)
on 2007-11-08 07:44
(Received via mailing list)
I'm trying to sent a file to the iphone (which requires byte-range
request support) using the rails send_file method. However, this
fails, I think because of mongrel. I think so because if I send the
iphone a file handled by nginx, it plays it fine. But then when I
serve the file with rails the iphone can't play it.

Any ideas?

Alex
B803304e3127325a8621524d7aaccbce?d=identicon&s=25 Pete DeLaurentis (Guest)
on 2007-11-08 17:44
(Received via mailing list)
Hi Alex,

Check out the x_send_file plugin. When you use this to send a file,
it just sends the location on disk to the web-server (in a special
HTTP header).

The webserver then looks up the file + streams it down to the
client.  I've noticed a huge speed boost after switching to x_send_file.

Since you observed that files sent by nginx work on your iPhone, this
would allow nginx to do the heavy lifting for you.

I know that Lighttpd + Apache support X-Send-File, although I'm not
sure about nginx.

Hope this helps,
Pete
3459eacae7ca649029718a67866526a6?d=identicon&s=25 Nathan Vack (Guest)
on 2007-11-08 18:06
(Received via mailing list)
On Nov 8, 2007, at 10:43 AM, Pete DeLaurentis wrote:

> I know that Lighttpd + Apache support X-Send-File, although I'm not
> sure about nginx.

It does, though it's inexplicably called X-Accel-Redirect.

http://wiki.codemongers.com/NginxXSendfile

http://blog.kovyrin.net/2006/11/01/nginx-x-accel-r...

-Nate
Ca8efd0ba834b02b9b7dd34b5c6c2721?d=identicon&s=25 Kirk Haines (Guest)
on 2007-11-08 20:24
(Received via mailing list)
On 11/7/07, Alex Egg <eggie5@gmail.com> wrote:
> I'm trying to sent a file to the iphone (which requires byte-range
> request support) using the rails send_file method. However, this
> fails, I think because of mongrel. I think so because if I send the
> iphone a file handled by nginx, it plays it fine. But then when I
> serve the file with rails the iphone can't play it.

The other suggestions about using x_send_file or the equivalent are
the answer, but just to clarify, Mongrel does not currently support
byte-range requests.  We have discussed adding support for that,
however.


Kirk Haines
556728451f3406da709d2598233804b7?d=identicon&s=25 Alex Egg (Guest)
on 2007-11-08 20:26
(Received via mailing list)
Thank you for the clarification!
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2010-05-14 18:09
Pete DeLaurentis wrote:
> Hi Alex,
>
> Check out the x_send_file plugin. When you use this to send a file,
> it just sends the location on disk to the web-server (in a special
> HTTP header).
>
> The webserver then looks up the file + streams it down to the
> client.  I've noticed a huge speed boost after switching to x_send_file.
>
> Since you observed that files sent by nginx work on your iPhone, this
> would allow nginx to do the heavy lifting for you.
>
> I know that Lighttpd + Apache support X-Send-File, although I'm not
> sure about nginx.
>
> Hope this helps,
> Pete
Hi, is it possible to http-stream seekable mp4 videos with
X-Accel-Redirect? Or do I need to add some plugin or other stuff as
well? I am targetting the new <video> html5 tag and the iPhone.

Cheers,
This topic is locked and can not be replied to.