[squid-users] Is there a way to select a cache peer before URL rewrite occur ?

From: Lucas Brasilino <lucas.brasilino_at_gmail.com>
Date: Mon, 8 Jun 2009 16:56:57 -0300

Hi all:

I wonder if it's possible to select a peer before URL rewrite takes
place. This my scenario:

I've got 2 domains: www.foo.org and www.bar.org, and a rewriter that
does the following rewriting:

www.foo.org => localhost/foo
www.bar.org => localhost/bar

My config is:

cache_peer localhost parent 1080 0 originserver name=foo
cache_peer localhost parent 1081 0 originserver name=bar

acl bar_acl dstdomain .bar.org
acl foo_acl dstdomain .foo.org
cache_peer_access foo deny bar_acl
cache_peer_access bar deny foo_acl

Will not work. Debuging section 28 I saw that 'cache_peer_access' is checked
*after* the URL rewrite, so It does against 'localhost/foo' and
'localhost/bar', not
against 'www.foo.org' or 'www.bar.org'.

 I know that using 'url_regex' it'll work. But since 'dstdomain' (and others)
uses splay tree, it's less CPU intensive than using regexes.... In such busy
sites it makes a large difference.

Any tip ?

regards
Lucas Brasilino
Received on Mon Jun 08 2009 - 19:57:07 MDT

This archive was generated by hypermail 2.2.0 : Thu Jun 11 2009 - 12:00:03 MDT