小编Vas*_*ily的帖子

Chrome 在下载 MP4 视频 (~34MB) 时发出了太多请求 (~22000)

我们在我们的网站上托管了一些视频文件 (mp4)。

所有文件在谷歌浏览器中加载速度太慢,在 FF 中一切正常。
我测试了一个大小为 34MB 的文件的下载(我通过直接链接打开了该文件)。结果是:

  • Chrome发出了~22000(!) 个请求,传输了982MB
  • Firefox只提出了 5 个请求。

作为服务器,我们使用具有默认(与视频文件服务相关)设置的nginx

这里是 Chrome 和服务器之间的交互(前五个请求)。仅包括Range, Content-Length,Content-Range标题。
(< - Chrome 发送的标头,< - 服务器发送的标头):

> Initial request for file, usual GET  
< Content-Length:35690389  
< Content-Type:video/mp4  

Then a bunch of similar requests, on which the server responded with 206 status code:  
---  
> Range:bytes=0-  
< Content-Length:35690389  
< Content-Range:bytes 0-35690388/35690389  
---   
> Range:bytes=29100305-  
< Content-Length:6590084  
< Content-Range:bytes 29100305-35690388/35690389  
--- …
Run Code Online (Sandbox Code Playgroud)

http nginx google-chrome

8
推荐指数
1
解决办法
1008
查看次数

标签 统计

google-chrome ×1

http ×1

nginx ×1