Re: Cannot cache FTP request (HTTP experts advise needed)

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 31 Oct 2000 17:26:01 +0100

Robert Collins wrote:

> <without reading the source :-]>
> I think what Henrik meant was: squid doesn't differentiate between caching
> peer proxies and non-caching peer proxies; and the return 0 to return 1
> suggestion was to make squid default to caching replies from peers rather
> than default to not caching replies from peers. This might fix your issue
> and let cache the http response it recieves from the peer proxy.
> Rob

Well, not exacly.

If you read httpCachableReply source you will find a comment reading

  /* don't cache objects from peers w/o LMT, Date, or Expires */

about 10 lines below that there is

        else
            return 0;

By changing this to a "return 1" you invalidate the above comment, and
request received from peers are handled equal to request received
directly.

Or you could simply collapse the whole block from the comment to the
return, to simplify it to only read
        return 1;
Hopefully however the compiler will do this for you as none of the
statements have side effects, and all ends up in return 1...

To be entirely correct this should probably be implemented as a
cache_peer option, but doing so is slightly more work. However, if you
look how the parsing of the proxy-only flag is implemented it should be
quite easy to understand what pieces you need to add a flag indicating
this kind of odd peer, and add a if statement that return 1 for replies
received from there..

Note: The only non-obvious line there is the one with httpState->peer.
This checks if a cache peer was contacted to retreive the object.

--
Henrik Nordstrom
Squid hacker
--
To unsubscribe, see http://www.squid-cache.org/mailing-lists.html
Received on Tue Oct 31 2000 - 10:36:27 MST

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