Re: [squid-users] how can I query squid cache?

From: ying lcs <[email protected]>
Date: Fri, 13 Jul 2007 01:23:56 -0500

Will this idea work if i just send out a HTTP HEAD reqest?
instead of HTTP GET?

I basically want to avoid loading the whole file just to check if
squid cache has certain url in its cache.

Thank you.

On 7/12/07, Andreas Pettersson <andpet@telia.com> wrote:
> ying lcs wrote:
> > Thanks for all the help.
> > One more question (hopefully the last),
> > is it possible for me to link in the squidclient in my c/c++ program?
> >
> > I would like to do this "squidclient -H "Cache-Control: only-if-cached\n"
> > 'http://www.freebsd.org/' | head -1 | awk '{ if ($2=="200") print
> > "cached!"; else print "not cached"; }'"
> >
> > programically in my program.
>
> While it would be possible, you might want to use functions for speaking
> proxy http directly instead. If you can't find any it is quite simple to
> generate the whole query yourself; here's an example using netcat:
>
> echo "GET http://www.freebsd.org/ HTTP/1.0\nCache-Control:
> only-if-cached\n\n" | nc <proxyserver> <proxyport> | head
>
> --
> Andreas
>
>
>
Received on Fri Jul 13 2007 - 00:23:59 MDT

This archive was generated by hypermail pre-2.1.9 : Wed Aug 01 2007 - 12:00:03 MDT