Re: [squid-users] Question about url redirection

From: Snowy <xuefeng18@dont-contact.us>
Date: Thu, 4 Jul 2002 15:31:58 +0800

> hi, thanks so far.
> I am note sure if I really understand this: in my example: will there be
> caching or not???
> I can see that server1 and server2 objects are in the cache (using
> purge), so there should
> be caching, or not!?

As far as you see server1 and server2 URLs in Squid's access.log file, Squid
is caching those objects. If you are not sure, you can try to use your IE
browser to access the same object and trace the log file. If you got a
"TCP_HIT" or "TCP_MEM_HIT" message, it means you have achieved it. :)

> So, if I want redirection to internal servers AND caching, do I have to
> do the following:
> s,http://www.buying.com,http://www.buying,com,
> s,http://www.shopping.com,http://www.shopping.com,
> together with entries in my local hosts file:
> www.buying.com 192.168.0.1
> www.shopping.com 192.168.0.2
> where these are the internal ip addresses of the servers???
>
> but if this is so, I never would be able to cache a website which is
> on different servers (e.g.: the static parts on server1 and the
> dynmamic parts on server2)

No, you don't have to do so. "1-1 mapping" means you can map one URL to
another unique URL which is not necessary to be the same URL. You can
redirect a URL to any other internal server's URL. Hence, the "server1" and
"server2" redirect scheme you have mentioned in previous email should work
nicely as far as Squid knows how to resolve the hostnames to the internal
server's real IP addresses. Another possible scheme could be mapping
different URLs into the same internal server but different directories. Eg.

^http://www.shopping.com ==> http://server.internal.other.com/static
^http://www.buying.com ==> http://server.internal.other.com/dynamic

Though the mapping destination is to the same server hostname, but the
different directories can easily tell the URLs apart, so Squid won't get
confused.

Cheers!

snowy
Received on Thu Jul 04 2002 - 01:32:22 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:09:01 MST