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?