Reputation: 9590
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.
Upvotes: 5
Views: 2118
Reputation: 2071
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>
Upvotes: 0
Reputation: 10493
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.
Upvotes: 1