Rails 3.2 streaming

前端 未结 1 1629
感动是毒
感动是毒 2021-01-04 12:54

I am working on a streaming download (CSV) from Rails 3.2 and am coming up against an issue of the initial page request taking a long time. The following controller code ill

1条回答
  •  伪装坚强ぢ
    2021-01-04 13:45

    The edited question turned out to contain exactly the answer I needed. Posting it here as an answer.

    The answer to getting the Rack handler to stream properly is apparently to add a Last-Modified header to the response:

    self.response.headers['Last-Modified'] = Time.now.ctime.to_s
    

    0 讨论(0)
提交回复
热议问题