Chunk videoplayback response to avoid throttling

This commit is contained in:
Omar Roth
2019-06-26 14:43:33 -05:00
parent b31d1c06f5
commit 818cd2454d
3 changed files with 66 additions and 30 deletions

View File

@@ -656,7 +656,7 @@ def proxy_file(response, env)
end
# https://stackoverflow.com/a/44802810 <3
def copy_in_chunks(input, output, chunk_size = 4096)
def copy_in_chunks(input, output, chunk_size = 8192)
size = 1
while size > 0
size = IO.copy(input, output, chunk_size)