On Monday 07 January 2002 16.38, Stuart Smith wrote:
> I am using Squid as a proxy for end users. However, for a certain subset
> of the internet I have written another cache (which is ICP compliant)
> and this serves that content. I want Squid to ALWAYS come to my cache
> for first. If I say is an ICP_MISS, then I want squid to get it itself,
> otherwise if I say it is an ICP_HIT (i.e. the subset of the internet my
> cache is managing) then squid should come to me and get the content (but
> not cache it).
You can get close by doing the following:
1. Set it up as a parent
2. prefere_direct off
3. Instead of returning ICP_MISS, return ICP_MISS_NOFETCH
4. If you after all get a request, return a small 504 error. Squid should
automatically recover.
> Also, the subset of the internet I am handling might change. When it
> does, and I am now handing say cnn.com which I didn't before, I purge
> squid of all cnn.com stuff. It then sends out its ICP_QUERYs again and
> gets an ICP_HIT next time.
This is a bit of a problem. To purge all of cnn.com you need to keep track
of which URL's you (Squid) have cached for cnn.com. Squid does not.
> cache_peer 127.0.0.1 parent 80 9999 proxy-only weight=1
> cache_peer 127.0.0.1 parent 3128 3130 weight=2
The reference to itself is of no use, as Squid always rejects requests
from itself, telling the requesting Squid that it has selected a bad path.
Recovery applies.
> Squid gets request for http://www.fish.com. It sends out an ICP_QUERY to
> me AND to itself. It always a MISS from me, and may or maynot get a MISS
> from its parent (itself). If it gets a MISS, it HTTPs us both for the
> object. I just ignore the request (closing the stream), it then
> dtermines that it has a forwarding loop, and serves the request
> itself... which is what I wanted it to do.
You would get the same thing if you got rid of the reference to self I
think.
> So, my question is.. is having Squid as it's own parent in this way
> reliable with future versions ? i.e. is it defined behaviour that if it
> detects that an HTTP request has come from itself, that it realises that
> it is a loop, and does start sending out more ICP requests and looping
> for ever, but rather gets it from the source right there and then ??
Loop detection is guaranteed to be there, but I don't see the value of at
all triggering such loops in your setup.
Regards
Henrik Nordstr�m
-- MARA Systems AB, Giving you basic free Squid support Customized solutions, packaged solutions and priority support available on requestReceived on Mon Jan 07 2002 - 10:51:16 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:05:39 MST