我们在我们的网站上托管了一些视频文件 (mp4)。
所有文件在谷歌浏览器中加载速度太慢,在 FF 中一切正常。
我测试了一个大小为 34MB 的文件的下载(我通过直接链接打开了该文件)。结果是:
作为服务器,我们使用具有默认(与视频文件服务相关)设置的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)