Re: [SQU] Writing a script to view and download the contents of proxy cache?

From: Henrik Nordstrom <[email protected]>
Date: Mon, 19 Feb 2001 09:13:37 +0100

Colin Campbell wrote:

> The name of the file actually includes the path to get there. That file
> "0000001A" is actually "00/00/1A". Now, which cache is it in? Dunno cos
> that file exists in every cache_dir.

There should be another field close by containing the cache_dir number
(hmm.. maybe this only is in Squid-2.4, not sure about 2.3)

> > Am I using the correct logfile?
>
> Since you don't know which cache is in use at the time, I'd say not.

The current log format includes the cache_dir number, but there are
other larger reasons why parsing store.log might not be the appropriate
approach:

a) The cache is usually more long-lived than store.log
b) Many versions of Squid forget to log when objects are deleted from
the cache.

> You cannot, easily. Since squid is designed to find out quickly if a URL
> is cached it uses two hashes. The first hashes the URL. This becomes the
> key to a (hash) lookup in swap.state. The data returned is the filename
> containing that URL.

And because of this you cannot use the cachemgr interface for finding
this information.

> The only surefire way to look at the cache is to scan it, reading the
> headers in each file to determine what you are looking at.

Agreed.

--
Henrik Nordstrom
Squid Hacker
--
To unsubscribe, see http://www.squid-cache.org/mailing-lists.html
Received on Mon Feb 19 2001 - 01:47:14 MST

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