On 06/10/10 22:55, mohd hafiz wrote:
---------- Forwarded message ----------
From: mohd hafiz<bmhafiz@xxxxxxxxx>
Date: Wed, Oct 6, 2010 at 5:17 PM
Subject: Re: URL redirection in offline mode
To: Amos Jeffries<squid3@xxxxxxxxxxxxx>
thanks for fast respon,
my squid will have to operate in network up and down. it will just do
normal operation when the network is up. When the network is down,
squid will intercept all request from client and point it to local
server. i write a perl script to do the redirection.
No need for that. redirect is automatic by prefer_direct. The local
server just needs to accept the random domains passed to it by Squid.
i have configure my cache_peer to:
cache_peer example.com 3128 3130 default
example.com being your "local server". Is that another proxy or a web
server? The answer will determine whether you use port 3128/3130 or 80/0.
and enable
prefer_direct on
but the browser still tried to reach the internet. it takes a few
minutes to resolve to my local page. any advised?
Are you doing WCCP, NAT interception or transparent proxy?
If yes,
the browser will be attempting and failing its own DNS to go direct
to the Internet Squid cannot help here. Connectivity failover with a
proxy is not easily compatible with interception.
If no,
Squid should be receiving an ICMP message from your router or its own
outgoing NIC indicating the Internet is unavailable. If that is not
happening you need to fix it.
connect_timeout value can be tuned to adjust the time Squid waits
before attempting the peer. Squid will try connect_timeout (1 minute)
for each IP of the website before attempting another route.
dns_timeout may also help if your DNS server is taking too long when
the network is down. Default there is 2 minutes.
Amos
--
Please be using
Current Stable Squid 2.7.STABLE9 or 3.1.8
Beta testers wanted for 3.2.0.2