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.

allesklar
  • 9,506
  • 6
  • 36
  • 53

2 Answers2

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.

Richard Hulse
  • 10,383
  • 2
  • 33
  • 37
  • The PassengerBufferResponse option becomes an issue in Passenger 3.0.11 http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerBufferResponse – concept47 Jul 26 '12 at 08:10
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>
mockaroodev
  • 2,031
  • 1
  • 20
  • 24