cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Problems caching data (libcurlnet)

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 3 Sep 2012 21:17:53 +0200

On Mon, Sep 03, 2012 at 10:39:12AM +0200, Farkas H wrote:
> I send http-get requests via curl (libcurlnet 1.3) and want to cache the data.
> It doesn't work, curl seems to make the data not cacheable.
> I changed the CURLOPT_HTTPHEADER but that wasn't successful.
> Squid access.log: "... TCP_CLIENT_REFRESH_MISS/200 ..."
> Please find my code here [1].

Versions of curl until 7.19.3 (released 4 years ago) used to send the
"Pragma: no-cache" header by default which would cause this. I don't
know what version of libcurl is being used by libcurlnet 1.3, but
upgrading might solve it. You should also be able to set an empty
"Pragma:" header which should remove the one generated by libcurl.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-03