cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: libcurl cache?

From: Gonzalo Diethelm <gonzalo.diethelm_at_diethelm.org>
Date: Fri, 01 Apr 2005 16:19:41 -0400

Usually you need more than that. From a JSP snippet:

response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader("Expires", 0); //prevents caching at the proxy server

Regards.

On Fri, 2005-04-01 at 10:44 -0500, Michael Smith wrote:
> I am using libcurl 7.12.1. I have tried the following, and have no improvement:
>
> pheaders = curl_slist_append(pheaders,"Pragma: no-cache");
> curl_easy_setopt(curl, CURLOPT_HTTPHEADER, pheaders);
>
> The symptoms are quite clear:
> When the contents of a previously downloaded file are changed on the web server, with the CURLOPT_NOBODY option set the new filesize and modified time are not reflected.
>
> When we delete the Internet Explorer cache using the IE options on the client, the new changes are reflected.
>
> This is a sample URL http://www.tsr.ch/meteoimages/SMATj1_300x240.jpg.
>
> Can anyone guide me to which http headers might be helpful?
>
> Thanks,
> Mike
>
>
>
> -----Original Message-----
> From: curl-library-bounces_at_cool.haxx.se
> [mailto:curl-library-bounces_at_cool.haxx.se]On Behalf Of Dan Fandrich
> Sent: Tuesday, March 29, 2005 4:19 PM
> To: curl-library_at_cool.haxx.se
> Subject: Re: libcurl cache?
>
>
> On Tue, Mar 29, 2005 at 02:09:32PM -0500, Michael Smith wrote:
> > This may be a very silly question, but I'm still going to ask it.
> >
> > Does the libcurl have its own cache similar to a web browser for instance?
> >
> > In the following code purl->fGetBodyContent is set to FALSE and somehow I have
> > been told that dwFileSize and lLastModified time remain the same eventhough the
> > file has been updated on the webserver. Is this possible?
>
> Could there be a proxy between you and the host that's doing the caching
> (an explicit one or a transparent one)? Try adding the appropriate HTTP
> headers to disable proxy caching along the path of the request.
>
> >>> dan

-- 
Gonzalo Diethelm
gonzalo.diethelm_at_aditiva.com
Received on 2005-04-01