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

From: Cameron Just <c.just@dont-contact.us>
Date: Fri, 16 Feb 2001 23:14:50 +1000

Hi,

I was wondering if it is possible to view and download the contents of a squid server via a web browser?
I have checked the FAQs and could find any reference to it.

I have since decided to write a script in php which will analyse the contents of theproxy cache and make it available via a webbrowser.

I am using squid-2.3.STABLE1-5
 
I first look at the contents of store.log and retrieve what I believe to be the contents of the cache at the moment. I then have a linkto another page which will dump the contents of the relavent file in the cache to the browser. The script will tell the browser what sort of file it is by sending the appropriate headers.

Here is a line from store.log
982373047.567 SWAPOUT 0000001A 200 982327734 956284084 -1 image/gif 1020
2/10202 GET http://ads.msn.com/ads/HOTBOS/00338AH0014_LG.gif

I have two problems at present.
1. Once I have the name of the file in the cache
ie
0000001A
How do I know where it is in the cache directory structure stored on the disk?
The directory structure is quite deep and I can't quite see any strict pattern for locating the file

2. Even downloading what I believe to be a GIF from the cache directory and renaming it to a .gif file. I cannot view it in anyimage viewer.
Why?
Is the file in some weird format?

So my main questions are
Am I using the correct logfile?
How canI find out the exact location and filetype of a file stored in the cache?

Thanks

--
To unsubscribe, see http://www.squid-cache.org/mailing-lists.html
Received on Fri Feb 16 2001 - 06:04:09 MST

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