cURL / Mailing Lists / curl-library / Single Mail

curl-library

Reducing the number of DNS queries in the multi handle.

From: Tsachi <tsachi.kimel_at_gmail.com>
Date: Wed, 26 Nov 2008 12:41:01 +0200

Hi,
(I am using "libcurl 7.19.1" with c-ares 1.5.3 (over linux)).
I am writing a program that uses the libcurl to fetch a bundle of urls
using the multi interface.

Now, many of the urls I am fetching belongs to the same domain.
Example: www.aaa.com , www.aaa.com/1/ , www.aaa.com/2/

I can see that all DNS requests are sent at the beginning (probably
right after calling curl_multi_perform()) that's b/c I am using
asynchronous name resolves.
I have noticed that the libcurl issues a different dns request for
every URL in the multi handle although many of them share the same
domain.
This means that for the example above I get to see 3 DNS requests for
www.aaa.com.

I am wondering if there is an option that I can use to tell the
libcurl to issue only one DNS request for www.aaa.com and only when
response arrives perform the HTTP requests for all the URL's sharing
the same domain ?

Thanks,
Tsachi
Received on 2008-11-26