You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: lib/zip_kit/output_enumerator.rb
+11
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,17 @@ def each
112
112
# but are of a file format built "on top" of ZIPs - such as ODTs, [pkpass files](https://developer.apple.com/documentation/walletpasses/building_a_pass)
113
113
# and ePubs.
114
114
#
115
+
# More value, however, is in the "technical" headers this method will provide. It will take the following steps to make sure streaming works correctly.
116
+
#
117
+
# * `Last-Modified` will be set to "now" so that the response is considered "fresh" by `Rack::ETag`. This is done so that `Rack::ETag` won't try to
118
+
# calculate a lax ETag value and thus won't start buffering your response out of nowhere
119
+
# * `Content-Encoding` will be set to `identity`. This is so that proxies or the Rack middleware that applies compression to the response (like gzip)
120
+
# is not going to try to compress your response. It also tells the receiving browsers (or downstream proxies) that they should not attempt to
121
+
# open or uncompress the response before saving it or passing it onwards.
122
+
# * `X-Accel-Buffering` will be set to 'no` - this tells both nginx and the Google Cloud load balancer that the response should not be buffered
123
+
#
124
+
# These header values are known to get as close as possible to guaranteeing streaming on most environments where Ruby web applications may be hosted.
0 commit comments