module ActionController::Streaming

def _process_options(options) #:nodoc:

:nodoc:
Set proper cache control and transfer encoding when streaming
def _process_options(options) #:nodoc:
  super
  if options[:stream]
    if env["HTTP_VERSION"] == "HTTP/1.0"
      options.delete(:stream)
    else
      headers["Cache-Control"] ||= "no-cache"
      headers["Transfer-Encoding"] = "chunked"
      headers.delete("Content-Length")
    end
  end
end

def _render_template(options) #:nodoc:

:nodoc:
Call render_to_body if we are streaming instead of usual +render+.
def _render_template(options) #:nodoc:
  if options.delete(:stream)
    Rack::Chunked::Body.new view_renderer.render_body(view_context, options)
  else
    super
  end
end