Re: refresh.cc - refreshIsCachable()

From: Duane Wessels <wessels@dont-contact.us>
Date: Wed, 26 Apr 2006 17:10:02 -0600 (MDT)

On Tue, 25 Apr 2006, Doug Dixon wrote:

> It looks like the call to refreshCheck() is only used to short-circuit the
> function (if you can call it a short circuit, given the size of the callout)
> and to update some statistics.

The main, and original, purpose of refreshCheck() is to check the request
against the 'refresh_pattern' configuration values from squid.conf.

> I can't see the reason stats being used anywhere, but maybe I overlooked
> something. (And anyway... should this function even be updating the
> refreshCounts[rcStore].total stat, given the fact this just checks a couple
> of flags?)

The 'reason' return value and related statistcs are definately used.
You can see refresh statistics in the cache manager 'refresh' page.

> However, the return value can be calculated without calling it, and the
> statistic it updates is never used. Would something like this be
> cleaner/quicker and still correct?

I'm not sure which function "it" refers to.

We can't NOT call refreshCheck(), ala your suggested refreshIsCachable()
replacement. refreshIsCachable() could be made slightly shorter and
cleaner, but I don't think its worth the trouble.

Duane W.
Received on Wed Apr 26 2006 - 17:10:03 MDT

This archive was generated by hypermail pre-2.1.9 : Mon May 01 2006 - 12:00:03 MDT