Re: introducing myself

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 22 Mar 2004 18:43:20 +0100 (CET)

Please keep discussion on squid-dev.

On Mon, 22 Mar 2004, Michal Matusiak wrote:

> Hello
>
> This is first (and most important in this moment) question I have about
> ETag support.
>
> (I use short form LM instead of Last-Modified, I write this to avoid confusion)
>
> What happens when there is cached object without LM but with ETag?

The intention is that there should then be a If-None-Match request using
the ETag of the expired object.
 
If there is no priorly known object matching the request then
If-None-Match should include all the known ETags of this URL.

> Let's assume that our object is STALE when the request comes.
> Squid should validate but finds that object has no LM so this is MISS.
> But the object has ETag. Why this ETag is not used as validator?
> We found that during our tests of Squid behaviour but later I've analyzed
> the code of client_side.c (with ETag patch) and I found those lines:
>
> ...
> r->flags.need_validation = 1;
> if (e->lastmod < 0) {
> /*
> * Previous reply didn't have a Last-Modified header,
> * we cannot revalidate it.
> */
> http->log_type = LOG_TCP_MISS;
> ...

Hmm...

> In my opinion ETags should be used as validator even when Last-Modified
> header field is not present. Am'I completely wrong or what?

You are correct.

And a quick verification of the etag-2.5 branch does indeed verify your
claim that this does not work the way it is intended. Looking a bit
further it is even mentioned in the etag todo list:

   http://devel.squid-cache.org/etag/

From a quick peek in the code most of the logics for handling this kind of
object seems to be there, but obviously some small details like the code
you indicated prevents it from being used in this specific case. There is
also some other places involving request->lastmod which prevents this from
working the way it is intended (clientProcessExpired for one).

Regards
Henrik
Received on Mon Mar 22 2004 - 10:43:24 MST

This archive was generated by hypermail pre-2.1.9 : Thu Apr 01 2004 - 12:00:04 MST