File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
actionpack/lib/action_controller/metal Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,21 @@ module ActionController
34
34
# The final caveat is that your actions are executed in a separate thread than
35
35
# the main thread. Make sure your actions are thread safe, and this shouldn't
36
36
# be a problem (don't share state across threads, etc).
37
+ #
38
+ # Note that Rails includes `Rack::ETag` by default, which will buffer your
39
+ # response. As a result, streaming responses may not work properly with Rack
40
+ # `2.2.x`, and you may need to implement workarounds in your application.
41
+ # You can either set the `ETag` or `Last-Modified` response headers or remove
42
+ # `Rack::ETag` from the middleware stack to address this issue.
43
+ #
44
+ # Here's an example of how you can set the `Last-Modified` header if your Rack
45
+ # version is `2.2.x`:
46
+ #
47
+ # def stream
48
+ # response.headers["Content-Type"] = "text/event-stream"
49
+ # response.headers["Last-Modified"] = Time.now.httpdate # Add this line if your Rack version is 2.2.x
50
+ # ...
51
+ # end
37
52
module Live
38
53
extend ActiveSupport ::Concern
39
54
You can’t perform that action at this time.
0 commit comments