cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Important info about caching

From: codemastr <codemstr_at_ptd.net>
Date: Mon, 9 Feb 2004 17:42:06 -0500

I just have one info regarding CURLINFO_TIMECONDITION. This is rather
trivial but it seems rather important really. Which should be 1 and which
should be 0?

Meaning should it be 1 if 304 is returned (or last-mod check fails)
or should it be 1 otherwise (i.e. complete download)?

It seems using 1 for the latter makes the most sense since we're checking
whether the time condition was met. E.g. "return it to me if it is newer
than 1 day old." Then, file is newer than 1 day old == success (1), file is
older than 1 day == failure (0). However this seems kind of counterintuitive
to me. What do you think?

Dominick Meglio

----- Original Message -----
From: "Daniel Stenberg" <daniel-curl_at_haxx.se>
To: "libcurl and curl development talk" <curl-library_at_cool.haxx.se>
Sent: Monday, February 09, 2004 8:52 AM
Subject: Re: Important info about caching

> On Fri, 6 Feb 2004, codemastr wrote:
>
> > > This particular case could in fact also be solved by adding another
> > > variable readable with curl_easy_getinfo(). Perhaps that is the
cleanest
> > > solution.
> >
> > Yeah that might work. something along the lines of:
> > curl_easy_getinfo(curl, CURL_INFO_TIMECONDITION, &bool);
> > if (bool == 1)
> > /* The time condition was met and therefore the file was downloaded */
> > else
> > /* The time condition was not met and therefore the cached version
should be
> > used */
> >
> > Again, if you think that's a good solution I'd be glad to work on it.
>
> I would indeed accept this functionality, please provide a patch!
>
> > Regardless though I've attached a minor patch to update the docs.
>
> Thanks!
>
> --
> Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
> [[ Do not send mails to this email address. They won't reach me. ]]
>
>
Received on 2004-02-09