Re: ICP & HEAD requests

From: Chris Wedgwood <>
Date: Mon, 7 Sep 1998 18:35:52 +1200

On Mon, Sep 07, 1998 at 07:24:30AM +0200, Henrik Nordstrom wrote:

> Well.. beta24 was very confused by HEAD replies, and had some other
> mismatches between persistent and non-persistent server
> connections.. I have now submitted a patch to squid-bugs that tries
> to tidy up this small mess.

Ooo.. I think I fixed this locally. Are your patches available
somewhere so I can check this out?

> Squid has always tried to cache HEAD replies with various success.
> It is needed since HEAD is used by some common autoated tools (the
> most well known one is wget).

I think many common applications could and should use
If-Modifed-Since. I'm going to updated wget to do this, and after
that I'll check what Pavuk does.

> Your idea that HEAD replies should be seen as 0 bytes objects is
> not that stupid as HEAD is defined to give exactly the same headers
> as a GET would (but without the body), but it has some important
> drawbacks: mainly what to do if we get HEAD requests for expired
> objects?

I'm not sure I see a problem here - why can't we just do a HEAD or
zero-range GET and store it as such? The current semantics already
support partial object storage.

True, it might be more optimal when we see a HEAD to actually GET the
object when its expired, the reasoning behing this is that things
like wget often follow HEADs with GETs, but the more I think about
it, applications doing this are broken and should use IMS GET.

> Today Squid caches HEAD and GET replies with separate keys to allow
> HEAD replies to be cached without interfering with GET replies. The
> drawback from this is that some additional code is needed to keep
> them in sync (i.e. avoiding that one is newer than the other). This
> is mainly done by prefering headers from GET replies over those
> from HEAD replies unless the GET reply has expired/needs
> revalidation (which can cause a new object to be transferred,
> defeating the purpose of HEAD).

I don't know the code all that well, but I think if possible, both
GET and HEAD replies should be stored the same way, my preference it
to store a HEAD as a GET with no body.

Received on Tue Jul 29 2003 - 13:15:53 MDT

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