cURL / Mailing Lists / curl-library / Single Mail

curl-library

Multi handle DNS cache sharing

From: codemastr <codemstr_at_ptd.net>
Date: Thu, 8 Jan 2004 19:59:03 -0500

Multi handle DNS cache sharing

I'm just wondering, first off, does libcurl support this? I quickly glanced
through the code and I didn't see it.

If not, here is my reasoning.

First off, it is a sorta-fix for the whole global cache is not thread safe.
This way at least lookups in the same multi handle can share the same cache
in a thread safe manner.

In my application at least, the majority of file transfers in a single multi
handle will be from the same host. Therefore, having the multi handle share
the host cache would greatly improve the speed of the downloads. I suspect
such a thing is true for many programs. I just thought of 3 potential users
for libcurl where it would be true:

1.) Web based configuration files that are downloaded and parsed (that's
what my program does). In most cases people tend to store the configuration
files in a single location, not thrown over multiple servers.
2.) "Update checkers." Most update checkers first have to check a file that
lists the latest version, then actually download the updated version. In
most cases they are going to be on the same host.
3.) Web browser. Lets face it, it's rare that you go to a website and then
never click a link to another page of that website.

In all those instances, and probably more, the DNS would be much faster if
the multi handle had the ability to cache DNS results.

Any comments?

Dominick Meglio

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
Received on 2004-01-09