Hey Rodrigo
 

> Actually (2) is not possible using the public API if I remember 
> correctly because the response is wrapped inside a Rack::BodyProxy (or 
> something like that). That's why I used (3) when I needed to detect if 
> streaming was enabled. 
>

Good point! I hadn't noticed that in my experimenting, but that makes sense.

Another option would be to use the same convention as Rack::ETag 
> middleware and do not attempt to read the response if the Cache-Control 
> header is set to no-cache. ActionController::Live will set this header 
> on the first response.stream.write call (although there's still a bug 
> that will happen and affect the ETag middleware as well if the action 
> calls response.commit! before response.stream.write). 
>

Interesting idea about using the Cache-Control header.

>From my examination, I don't see the Transfer-Encoding set when we'd need 
it. Content-Length isn't there when using ActionController::Live, but it 
also isn't there yet on a normal controller, so that doesn't seem plausible 
to rely on either.

Thanks for the additional input and ideas!
~Jason

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to