cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Query regarding the caching problem faced with curl 7.19.3, how to disable cache usage ?

From: Bill Mercer <bmercer_at_nccer.org>
Date: Wed, 11 Jan 2012 22:44:29 +0000

You may want to try Cache-Control: no-cache. I believe the pragma: no-cache option is deprecated, but you might want to use both, in case your proxy server is old.
I'm not sure if you can set headers with curl_easy_setopt(), I haven't kept up with all that newfangled stuff. You might want to look at curl_slist_append().

Also, fyi, this list is aimed at users of the command line tool. For questions about using the curl library, you're probably better off using that mailing list.
http://cool.haxx.se/mailman/listinfo/curl-library

>-----Original Message-----
>From: curl-users-bounces_at_cool.haxx.se [mailto:curl-users-
>bounces_at_cool.haxx.se] On Behalf Of Arif Ali Saiyed
>Sent: Wednesday, January 11, 2012 8:07 AM
>To: curl-users_at_cool.haxx.se
>Subject: Query regarding the caching problem faced with curl 7.19.3, how
>to disable cache usage ?
>
>Hi There,
>
> I am using curl 7.19.3 in my C++ code.
>
>
>
>My code fetches some http file, my problem is even after the file is
>being updated on web server,
>
>It's still downloading the cached copy of it.
>
>
>
>I want to know how to disable this behavior
>
>I have tried following easy set option but it did not work me
>
> curl_easy_setopt(handle, CURLOPT_FRESH_CONNECT, 1); //
>I guess this has got nothing to do with cache but still I tried and it
>did not help
>
> curl_easy_setopt(handle, CURLOPT_FORBID_REUSE, 1); //
>I guess this has got nothing to do with cache but still I tried and it
>did not help
>
> curl_easy_setopt(handle, CURLOPT_SSL_SESSIONID_CACHE, 0); //
>I guess this has got nothing to do with cache but still I tried and it
>did not help
>
>
>
>after some search I found that there is something called
>"Pragma:nochache" header,
>
>but I am not sure how to use this ? there is no curl_easy_setopt for
>doing this.
>
>
>
>Though its not needed following is the codesnippet of how I am using
>curl
>
>
>
> CURL* handle = curl_easy_init();
>
> CURLcode err = CURLE_READ_ERROR;
>
> if(handle)
>
> {
>
> currentStatus = kInitiated;
>
> curl_easy_setopt(handle, CURLOPT_URL, myFileName);
>
> curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION,
>my_write_data_handler);
>
> err = curl_easy_perform(handle);
>
> curl_easy_cleanup(handle);
>
> curl_global_cleanup();
>
> currentStatus = kCompleted;
>
> }
>
>
>
>-asaiyed
>
>

-------------------------------------------------------------------
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-01-11