cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Does libcurl cache downloads?

From: <Zibiao.Wei_at_atxinc.com>
Date: Tue, 27 Dec 2005 14:35:49 -0500

However, I watched that the delay between the last Write callback and the
detection of download completion by curl_multi_perform is noticeable if
using ftp. This delay if using http is negligible What is going on after
the last ftp data pack is received?

Bill Wei

Dan Fandrich <dan_at_coneharvesters.com>
Sent by: curl-library-bounces_at_cool.haxx.se
12/22/05 04:52 PM
Please respond to
libcurl development <curl-library_at_cool.haxx.se>

To
libcurl development <curl-library_at_cool.haxx.se>
cc

Subject
Re: Does libcurl cache downloads?

On Thu, Dec 22, 2005 at 03:40:28PM -0500, Zibiao.Wei_at_atxinc.com wrote:
> I traditionally thought ftp is faster then http download. I did some
tests
> using libcurl for both ftp and http. When download the same set of
files, http
> is always much faster than ftp, for example,
> Download 229 files through Intranet, it takes 20 seconds for http and 48
> seconds for ftp.
> Download 94 files through Internet, it takes 15 seconds for http and 75
seconds
> for ftp.
> Why http is so fast? Does libcurl (or any router) cache downloaded files
like
> the web browser?

libcurl doesn't do any data caching, so the speed differences you are
seeing
are a result of other factors. There may be a transparent http proxy
between
you and the server that is doing some caching without your knowledge, but
it's more likely that the ftp session connection overheads are what's
slowing down your ftp transfers: each file downloaded with ftp needs a new
TCP connection established. There is also several more round-trips needed
to start an ftp transfer, including one for each directory path component.

The CVS (and daily snapshot) version of curl contains an experimental (and
undocumented) command-line option --ftp-method=X where X is singlecwd,
nocwd or multicwd, that adjusts how curl changes directories on an ftp
server. Depending on the URLs you are downloading, this option could have
a
noticable effect on your ftp download times.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address 
service
          Let webmasters know that your web site has moved
Received on 2005-12-27