2

Rails 3.1 支持 HTTP 流,但仅限于兼容的 Web 服务器。宣布 3.1 候选版本的博客文章提到了 Unicorn: http ://weblog.rubyonrails.org/2011/5/22/rails-3-1-release-candidate

API 文档还提到了 Unicorn,并为乘客提供了一个存根: https ://github.com/rails/rails/blob/master/actionpack/lib/action_controller/metal/streaming.rb

有谁知道是否支持 Thin,如果支持,我在哪里可以找到配置信息?

4

1 回答 1

1

在 0.5.4 版本的发行说明中:

    == 0.5.4 Flying Mustard release
     * Don't read the full body, use direct streaming when sending response.
       See: Response#each
       As a result, the Content-Length can not be calculated anymore.
       You have to do set this in your adapter. All frameworks do it anyway.
       It improve memory usage and boost speed for low concurrency.
       Thanks to Kent Sibilev and Ezra for their help on that one.

但是,当我运行两个瘦实例(在不同的端口上,一个设置为资产主机)时,布局中的 CSS 和 JS 在sleep控制器操作中的调用完成执行之前没有加载。这是在生产模式下完成的。

我不是 100% 确定它的机制,也许需要设置瘦机架适配器以允许流式传输。

于 2011-05-24T11:32:07.470 回答