Search squid archive

Re: Is there a way to select a cache peer before URL rewrite occur ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 8 Jun 2009 16:56:57 -0300, Lucas Brasilino
<lucas.brasilino@xxxxxxxxx> wrote:
> 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 ?

The problem being that after the re-write the destination domain has in
fact altered. Whether a peer is involved or not. That is what re-writing
means.

Make the web server at localhost understand that it has two public domains
being serviced.
Only re-write the path portion of the domain to get the right file path, if
at all. Removing the need for re-writing will give a further large increase
in speed.

Amos


[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux