8
我想使用HttpResponse.OutputStream
連同ContentResult
,以便我可以不時地使用Flush
,以避免使用.Net使用太多的RAM。如何在不使用太多RAM的情況下正確地從MVC3中傳輸大數據?
但是所有帶有MVC FileStreamResult, EmptyResult, FileResult, ActionResult, ContentResult
的示例都顯示了將所有數據存入內存並傳遞給其中一個的代碼。還有一個帖子建議,返回EmptyResult
連同使用HttpResponse.OutputStream
是不好的主意。我怎麼能在MVC中做到這一點?
什麼是正確的方式來組織從MVC服務器的大數據(HTML或二進制)的可沖刷輸出?
爲什麼返回EmptyResult
或ContentResult
或FileStreamResult
一個壞主意?
有沒有人有關於使用管道流的信息在http://stackoverflow.com/a/2189635/37055中提到 –