Re: [squid-users] LM-factor and percent (Squid: The Definitive Guide)

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sun, 05 Jul 2009 18:21:26 +1200

Stand H wrote:
> Hi,
>
> I have another question regarding LM-factor.
>
> ---- qouted from Squid: The Definitive Guide
>
> Responses that fall between the minimum and maximum are subject to Squid's last-modified factor (LM-factor) algorithm. For such responses, Squid calculates the response age and the LM-factor and compares it to the percent value. The response age is simply the amount of time passed since the origin server generated, or last validated, the response. The resource age is the difference between the Last-Modified and Date headers. The LM-factor is the ratio of the response age to the resource age.
>
> Figure 7-2 demonstrates the LM-factor algorithm. Squid caches an object that is 3 hours old (based on the Date and Last-Modified headers). With an LM-factor value of 50%, the response will be fresh for the next 1.5 hours, after which the object expires and is considered stale. If a user requests the cached object during the fresh period, Squid returns an unvalidated cache hit. For a request that occurs during the stale period, Squid forwards a validation request to the origin server.
>
> ------
>
> "LM-factor value of 50%" Did he mean the percent in refresh_pattern or what? What I understand is we should compare LM-factor with the percent which is FRESH if "response age"/"resource age" < percent, else STALE. I don't understand why the response will be fresh for 1.5h. Can someone explain this to me?
>
> Sorry for asking stupid question. Thank you.

As the guide says in your own quote "The LM-factor is the ratio of the
response age to the resource age"

The refresh_pattern ^regex$ max percent min
  provides the word "percent" in the "< percent" calculation and max/min
similarly for the other tests.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE6 or 3.0.STABLE16
   Current Beta Squid 3.1.0.9
Received on Sun Jul 05 2009 - 06:21:32 MDT

This archive was generated by hypermail 2.2.0 : Sun Jul 05 2009 - 12:00:02 MDT