delphirules
delphirules

Reputation: 7438

TIdHTTP slow downloads

I use TIdHTTP to download updates of my application. The install file is about 80 mb.

It works, but I noticed that somehow, the download speed is way slower than the same link downloaded directly from Google Chrome.

Why does this happen? Is there any setup I should do on TIdHTTP to speed up the download?

Nothing fancy on my code, I just use the Get() method like this:

idh := TIdHTTP.Create(nil);
ssl := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
ssl.SSLOptions.Method := sslvSSLv23;
ssl.SSLOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];
f := TFileStream.Create(localFileName, fmCreate);
idh.Get(remoteFile, f);

Upvotes: 1

Views: 159

Answers (1)

mjn
mjn

Reputation: 36664

With TIdHTTP you may implement parallel downloading by launching two or more HTTP GET Requests in different threads, which each download a specific part of the resource. This however only will increase download speed if the system has enough CPU resources to execute the threads on different "cores".

See https://stackoverflow.com/a/9678441/80901 for some related information

Upvotes: 1

Related Questions