[Reposting this because it does not seem to arrive, please excuse if
you get it twice.]
I remember that some time ago I did want to generate an HTML table in
which each row would take several seconds for generating each line.
And I wanted to be able to view the generated HTML file as the rows were
At that time, Rails didn't support this. Am I right in assuming that
even Rails 3.1 won't support this kind of streaming support?
I mean, consider that my view won't set any variables for the layout to
be aware about. So the layout would be just plain HTML with a single
In 3.1, only the layout is streamed, so the table would be buffered.
In addition to that, producion setups have gotchas. For example, if
you use nginx + Unicorn with the recommended configuration, streaming
will technically work, but it only gets to nginx who buffers the
entire response. So in practice the client is not seeing the benefits.
In addition to that, the proxy of ngnix is 1.0, so it sends a 1.0
request to the proxied server. And Rails disables streaming for 1.0
requests because it is a 1.1 feature. They were trying to come with a
workaround for that somehow, not sure which is the situation as of
There's also the problem with compression, if you have it enabled
(which is a standard practice in normal production setups). The web
server should be able to dechunk, compress, and chunk the compressed
content, everything on the fly. The only combo that worked for me when
I did research about this a few weeks ago was Apache + Unicorn. Hongli
was also working on it for Passenger, I don't know which is the status
In general, this feature has to be considered experimental today.
Then, I would like to be able to send my response as they are generated.
Is that kind of support planned to be added in some later version of Rails?
Yes, it is in the radar, perhaps in some future version.