[redland-dev] [Patch] Disable libcurl Pragma: no-cache

Dave Beckett dave at dajobe.org
Sat Feb 23 22:26:45 GMT 2008


Ben Ranker wrote in Dec 2007:
> OK, I think I've got raptor_features figured out. The attached patch
> against raptor 1.4.16 adds a "noCache" feature (RAPTOR_FEATURE_WWW_NO_CACHE).
> noCache defaults to 0/false, signifying that caches may send cached
> resources. If a caller sets noCache true, raptor will send a "Pragma:
> no-cache" header in HTTP requests.
> 
> The patch adds a raptor_www_allow_cache(raptor_www*, int) API function
> that sets the new field www->allow_cache. allow_cache has the opposite
> sense of noCache. I've implemented allow_cache switching in
> raptor_www_curl.c and raptor_www_libxml.c, but I've only been able to
> test the curl implementation. The libfetch docs and source online don't
> offer a clear way to send a Pragma: header, so I left
> raptor_www_libfetch.c alone.
> 
> Let me know if this patch needs any extra work. Thanks for the
> raptor_feature pointer, Lauri!

Thanks for the patch, sorry about the time taken to reply.

I thought about this for a while and realised that I think that
curl's sending of Pragma: no-cache is just dumb.  Also I don't like
options that are negatively expressed.  So setting noDumbthing=true
just twists my brain.  Instead, from your patch I've made a new one
that adds features to control the HTTP headers directly:
   wwwHttpCacheControl   Set HTTP Cache-Control: header value (string)
   wwwHttpUserAgent      Set HTTP User-Agent: header value (string)

The defaults in both cases are empty

I've also attached these to a bug so people can track/see it, and
that is where my new patch is attached:
   http://bugs.librdf.org/mantis/view.php?id=252

I'm probably going to just commit this to SVN soon since I don't
see any downside, but I wanted to show the patch on it's own to
any people interested.

Dave


More information about the redland-dev mailing list