我将相同的视频文件(145 Mb 大小)从同一台计算机上传到同一台服务器。上传是通过带有 multipart/form-data 的 POST 请求完成的。如果我用 Postman 来做,上传大约需要 30 秒。如果我从浏览器(经过测试的 Chrome、FF、Safari)执行此操作,大约需要一分钟。
邮递员标头:
Cookie: __cfduid=d629ccab89f0d8996cbcd03fd85d7edad1588857074
Postman-Token: <calculated when request is sent>
Content-Type: multipart/form-data; boundary=<calculated when request is sent>
Content-Length: <calculated when request is sent>
Host: <calculated when request is sent>
User-Agent: PostmanRuntime/7.24.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
浏览器标题:
:authority: domain.com
:method: POST
:path: /file/add
:scheme: https
accept: application/json, text/plain, */*
accept-encoding: gzip, deflate, br
accept-language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
cache-control: no-cache
content-length: 145506546
content-type: multipart/form-data; boundary=----WebKitFormBoundaryWWuN1xlu5NeYmSLR
origin: https://somedomain.com
pragma: no-cache
referer: https://somedomain.com/
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
有谁知道为什么通过浏览器上传需要两倍的时间?