Re: Transparent-ly obtained objects in a name-based hierarchy: problems?

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 18 Feb 1998 08:58:13 +0100

John Todd wrote:

> How does one get around the discrepancy caused by IP-based versus
> name-based cache object storage when working in a hierarchy of
> mixed transparent and proxy-based caches?

Don't use IP-based cache names as it breaks virtual servers and limits
the cache hit ratio quite a bit (many servers have more than one IP, any
you may have clients using you as a normal proxy -> a lot of duplicated
objects that should only be cached once).

The host name is sent (by almost all clients) as a Host: header in the
request, and Squid can snarf the host name from there instead of using
the IP. All code needed is already in squid, it is only a matter of
enabling it and configuring squid.conf.

How to configure squid as a transparent proxy:

1.1.20:
Apply a small patch available from
http://hem.passagen.se/hno/squid/squid-1.1.20.host_and_virtual.patch
Edit squid.conf to read
httpd_accel virtual 80
httpd_accel_uses_host_header on
The patch changes the processing order of virtual and uses_host_header,
allowing you to use both at the same time, to support both pure 1.0 (no
Host: header) and 1.0+/1.1 clients (sending Host: header).

If you don't feel like patching your squid sources edit squid.conf to
read
httpd_accel www.some.server 80
httpd_accel_uses_host_header on
The downside is that the clients not sending a Host: header gets
connected to www.some.server instead of the intended server.

1.2:
Edit squid.conf to read
httpd_accel_host virtual
httpd_accel_uses_host_header on

Don't try 1.2beta in a production environment.

---
Henrik Nordström
Sparetime Squid Hacker
Received on Wed Feb 18 1998 - 00:05:05 MST

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