6

In the Railscasts about HTTP streaming some commenters have confirmed that one can do http streaming with Apache + Passenger but strangely I can't find any instructions via Google.

Also the Rails doc did not provide any instructions. All detailed instructions everywhere refer to Unicorn. I must not be the only one wanted to do http streaming over Apache and Passenger. Help please.

2 Answers 2

1

HTTP Streaming is more correctly known as Chunked Transfer Encoding.

These are the things I know about (there may be more requirements):

Ruby 1.9.x

Streaming requires the threading features of Ruby 1.9

Compatible middleware

Any middleware you have must not modify the HTTP response

Passenger

The passenger_buffer_response option must be turned off

Client Support

The client must advertise it uses HTTP 1.1 or send the TE request header.

I vaguely recall reading somewhere that nginx was needed, but I cannot find the reference anywhere.

I hope that helps.

1
0

I just set up Passenger under Apache with response streaming yesterday and had no trouble. Here is my virtual host config in httpd.conf:

<VirtualHost *:80>
  ServerName www.my.site.com
  DocumentRoot /var/rails/myapp/public    
  <Directory /var/rails/myapp/public>
     # This relaxes Apache security settings.
     AllowOverride all
     # MultiViews must be turned off.
     Options -MultiViews
     # Enable response streaming
     PassengerBufferResponse off
  </Directory>
</VirtualHost>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.