Re: squid disk cache replacement policy

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sat, 01 May 1999 19:19:00 +0200

Brian Beuning wrote:
>
> Thanks for the pointer, I saw that code but wasn't sure it was
> the right place. I guess I need to track down how store_list
> is maintained.

store_list is an LRU list of all objects in the cache. Each time an
object is accessed it is moved to the head of the list, and
storeMaintainSwapSpace looks at the tail.

> I use squid with wget as my personal web cache. What is not
> working right, is pages that wget pulled into the cache recently
> (within the last one or two days) often get purged before pages
> which have not been accessed for much longer.

It may be caused by "staleness", and not really cache replacement. Check
the pages headers (look for Expires, Last-Modified and no-cache) and
your refresh_pattern.

Also, changing the replacement policy to pure LRU may make a difference.
At least it will make it easier to understand what is going on.

How:

Change
        } else if (storeCheckExpired(e)) {
to
        } else {

--
Henrik Nordstrom
Spare time Squid hacker
Received on Sat May 01 1999 - 11:02:36 MDT

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