cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: using curl to create a caching tool

From: Gary Maxwell <gmaxwell_at_broadsoft.com>
Date: Thu, 9 Dec 2010 14:09:54 -0800

From: Ashish Agarwal
Sent: Thursday, December 09, 2010 10:48 AM
Subject: Re: using curl to create a caching tool

>> Ideally, there's already a library I can simply link into my application. Does anyone know if any of the web servers or browsers provide this component separately? Sorry if this is off topic, but I imagine libcurl would the underlying solution to this.
I am not aware of a library that provides this functionality. libcurl does not provide this solution because it only worries about getting data to and from your application using a network protocol. It has no idea (and does not care) what the application wants to do with the data.
For our application, we implemented a simple LRU data cache for content which sounds like what you are looking for. I cannot share the implementation, but it only involves several hundred lines of code. Content is stored with the URL as the key, which is hashed into a lookup table. Garbage collection is performed as necessary on the oldest entries when the maximum size of the cache is reached.
Cheers,
GaryM @ Broadsoft

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-09