簡體   English   中英

Rails 3.1 中的 HTTP 流式傳輸是否適用於 Thin?

[英]Does HTTP streaming in Rails 3.1 work with Thin?

Rails 3.1 支持 HTTP 流式傳輸,但僅適用於兼容的 web 服務器。 宣布 3.1 候選版本的博文提到了 Unicorn: http://weblog.rubyonrails.org/2011/5/22/rails-3-1-release-candidate

API 文檔也提到了獨角獸,並有一個乘客存根: https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/metal/streaming.rb

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

在 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 在 controller 操作中的sleep調用完成執行之前未加載。 這是在生產模式下完成的。

我不是 100% 確定它的機制,也許需要設置瘦機架適配器以允許流式傳輸。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM