On Fri, 27 Feb 2004, OTR Comm wrote:

> Could someone explain the relationship between the swap.state file and
> the actual files in the L2 directories?


swap.state contains an index and combined transaction log over which
objects are cached where in the L2 directories.

> Is the swap.state a database where Squid does it's cache checking and
> the L2 directory files where the data is presented from?


Yes.

> Also, if one of the cache files is deleted, does the swap.state maintain
> information about that file?


Yes, but Squid automatically recovers when encountering the mismatch.

> I am trying to understand how purging items from the cache works, and
> realize that has to be some relationship between swap.state and the L2
> files


Actually not.. purging operates at a higher level and results in the L2
file to be deleted and a delete operation to be logged in swap.state.

> but I looked in the code for client.c (ver 2.5) and client.cc
> (ver 3.0) and can not figure out where swap.state or the L2 files are
> addressed.


The squidclient program just sends a HTTP request to Squid asking it to
purge the file. It does not touch the cache directly.

It is only Squid himself which modifies the cache files.

Regards
Henrik