最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Why does it take more than 2 seconds until a file download via the google drive api (files.get with parameter alt=media) starts?

programmeradmin2浏览0评论

I am downloading files from my google drive using the Drive API:

GET /{id}?alt=media

For some reason it always takes more than 2 seconds until the server begins with the data transfer.

I am not talking about the overall download speed (throughput), I mean the initial delay between the HTTP request until the first bytes of the file are received. Even if the file content is just a few bytes (plain text) I experience this delay.

I am observing this dealy using python on windows, android on my smartphone (over 5G connection) or a simple curl command with linux. (e.g. curl -H "Authorization: Bearer ya29..." ...1920Cq?alt=media)

Wireshark also shows this: ~2 seconds delay between packets 19 and 20

The delay also occurs if I download the same file twice over the same HTTPS connection. I would at least expect that the second request of the same file is faster because of some caching mechanism.

The google drive android app and web UI does not seem to suffer from this delay...at least not to this extent.

Where does this delay come from and how can I avoid this?

发布评论

评论列表(0)

  1. 暂无评论