Streaming is broken in Rails by default

Could someone please review this issue from March?

https://github.com/rails/rails/issues/14358

This prevents streaming from working in Rails by default. The ETag middleware is enabled in the default stack and it has to read all content before generating the ETag hash. It will skip any processing if the Cache-Control header is set to no-cache but this is not managed automatically by Rails.

The solution might seem simple and simply tell people that they should add this header for streamed actions but some browsers have bugs for streamed responses containing both "Cache-Control: no-cache" and "Content-Disposition: attachement".

Currently in order to support streaming in my application I had to insert two other middlewares around the ETag one in order to detect the response is a streamed one and set and restore the Cache-Control header so that ETag generation is skipped for such actions. (code in the issue's comments)

Since Live Streaming is a major feature of Rails 4 and has been broken for a while already it would be great if it could be fixed for the next Rails release if possible.

Could someone please take a look at this issue?

That issue is not valid(see my response).

Beside, if you want to build realtime rails applications, you can try jubilee(https://github.com/isaiah/jubilee), which is a rack server that provides a mechanism to communicate with web via sockjs.

Yes, in the broader sense. But there's still an issue with streaming if you first call response.commit! before the first response.stream.write. I've updated the title and description a while ago once I noticed this.