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

From: ying lcs <yinglcs@dont-contact.us>
Date: Fri, 13 Jul 2007 14:31:59 -0500

On 7/13/07, Henrik Nordstrom <henrik@henriknordstrom.net> wrote:
> fre 2007-07-13 klockan 12:22 -0500 skrev ying lcs:
>
> > I tried to look at squirm, but that does not seem to work. Basically,
> > I just want to redirect the url from http://www.abc.com to
> > http://www.def.com in the squid cache.
>
> If it's sufficient that you redirect the browser to http://www.abc.com
> when they requested something from http://www.def.com then using
> deny_info works fine..
>
> acl abc.com dstdomain www.abc.dom
> http_access deny abc.com
> deny_info http://www.def.com abc.com
>
>
> This will redirect the browser to http://www.def.com on any request for
> something on the www.abc.com server.
>
> But if you want Squid to rewrite the requested URL on the fly from
> www.abc.com to www.def.com then you need to use an url rewriter helper.
> Squirm or one of the other existing redirectors should work for the
> purpose, or you could write your own. Writing a url rewriter helper is
> not a very complex thing..
>
> #!/usr/bin/perl -p
> BEGIN {$|=1;}
> s%^([^:]*)://([^/@]*@)?www.abc.com(:|/|\?|$)%$1://$2www.def.com$3% && next;
>
> the above strange things is to support all forms of http URLs pointing
> to www.abc.com.. scheme://[user[:password]@]host[:port][/path]
>
> If you just want to support the simplest form http://host then the
> pattern is also simpler
>
> s%^http://www.abc.com(/|\?|$)%$1://$2www.def.com$1% && next;
>
> Regards
> Henrik
>
Henrik,
Thank you for your help.
Actually, i want to rewrite the url before squid saves it in its cache.

I assume squid has a mapping table between an URL and cached file.
Can please point me to the code which does the adding the entries
between URL and cached file?

Thank you.
Received on Fri Jul 13 2007 - 13:32:04 MDT

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