Re:Re: A question about "clientProcessExpired" function.

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 9 Apr 2002 16:34:12 +0200

Correct.

And yes, there may be other more structured manners to do this than how it is
currently done. The code in both client_side.c and peer_select.c is somewhat
messy due to have been grown on for many years with new feature after new
feature added. The processing of only-if-cached is one such feature simply
added to the existing code where this was not originally thought of in the
design.

Regards
Henrik

maer727@sohu.com wrote:
> Hi, Henrik pal!
>
> Thanks for your reply. I have known the aim of the function. But why should
> we use such statements in this function? Such are my opinions:
>
> ///////////////////////////////////////////////////////////////////////////
>/////////////////////////////////////// In file "client_side.c", line 355,
> there are such statements,
> if (clientOnlyIfCached(http)) {
> clientProcessOnlyIfCachedMiss(http);
> return;
> }
> ///////////////////////////////////////////////////////////////////////////
>///////////////////////////////////////
>
> I think if "(clientOnlyIfCached(http))" returns true, it means the client
> only want to get the object from cache. But the aim of the function is to
> used for revalidation for expired objects. So if clients want to get object
> only from cache, we should use "clientProcessOnlyIfCachedMiss(http)" to
> retuen an error. (Since the object is out of date.)
>
> Am I correct? :-)
>
> Best regards,
> Geoege, Ma
>
> ----- Original Message -----
> From: Henrik Nordstrom
> To: maer727@sohu.com ;squid-dev@squid-cache.org
> Cc: squid-dev@squid-cache.org
> Subject: Re: A question about "clientProcessExpired" function.
> Sent: Tue Apr 09 17:05:54 CST 2002
>
> > On Tuesday 09 April 2002 06:03, maer727@sohu.com wrote:
> > > 1. After reading for several times, I can not find the goal the
> > > function "clientProcessExpired". What is it used for?
> >
> > Processing of requests where the cached entry has expired and needs
> > to be revalidated before given to the user.
> >
> > > 2. In file "client_side.c", line 355, there are such statements,
> > > if (clientOnlyIfCached(http)) {
> > > clientProcessOnlyIfCachedMiss(http);
> > > return;
> > > }
> > >
> > > I think the "clientOnlyIfCached" is used to check whether an object
> > > coule be taken from cache. "clientProcessOnlyIfCachedMiss" is used
> > > to return an error when the specific object is not in cache. But I
> > > think the above four lines of the statements do not conform the
> > > following comments.
> >
> > clientOnlyIfCached checks if the client requested to have the object
> > only satisfied from cache, disallowing any network retreivals.
> >
> > See the meaning of "Cache-control: only-if-cached" in RFC2616.
> >
> > > The comments are,
> > > /*
> > > * check if we are allowed to contact other servers
> > > * @?@: Instead of a 504 (Gateway Timeout) reply, we may want
> > > to return * a stale entry *if* it matches client requirements
> > > */
> >
> > Yes. This looks correct.
> >
> > Regards
> > Henrik
Received on Tue Apr 09 2002 - 08:34:21 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:00 MST