Re: HTTP Code 304 Question

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sat, 31 Oct 1998 16:10:39 +0100

RZ Dietmar Rahlfs wrote:
>
> Hello Squid Users,
>
> Code 304 "Not modified" appears in combination with
>
> TCP_CLIENT_REFRESH and DIRECT

User pushed reload. Clients cached copy is up to date.

> TCP_IMS_HIT and NONE

Cache hit. Clients cached copy is up to date with respect
to the copy cached by Squid.

> ERR_CLIENT_ABORT and DIRECT

Client aborted while we were sending the reply to it.
Clients cached copy is up to date.

> TCP_REFRESH_HIT and DIRECT

Squid validated it's cached object. Clients and Squids
cached copy is up to date.

> Does 304+DIRECT mean: Request from the Squid cache to the
> original server, and NONE: No request to the original
> server?

Yep. But if you are in a hierarcy then other combinations than
DIRECT/NONE are possible.

TCP_HIT and TCP_IMS_HIT are plain cache hits.

TCP_REFRESH_HIT are a cache hit where Squid validated it's cached object
at the origin server or next level cache and the server replied with a
304 "Not modified" reply.

TCP_REFRESH_MISS are when Squid validated it's cached object and the
server replied with a new object. Cache miss.

> In which of the four cases does the Squid cache or the
> original server deliver the object data (in none, RFC
> 2068 seems to say: no message body; but perhaps that
> refers only to the Squid cache to original server
> relation...?).

None. In all cases the client has a up to date copy.

> What means then "HIT"? I thought: fetched from the Squid
> cache.

It does, except that the 304 reply does not contain any data..

TCP_REFRESH_HIT is a exception. Here Squid has contacted the origin
server to check if the object has changed, and the server replied with a
304 reply indicating that the object has not changed yet.

> What is then TCP_CLIENT_REFRESH? I mean: the client (=browser?)
> wants an up-to-date object, the squid server then requests
> the original server which says: "The object is up-to-date", without
> delivering the object data.

TCP_CLIENT_REFRESH is a user-initiated forced revalidation of the cache.
If it is a 304 reply then the object has not changed and no data is
delivered.

> Who has the object data? The client? Then there is no need for Squid
> to fetch the object from the cache --> no HIT.

The client has the data in all four cases. Otherwise there would not be
a 304 reply sent to the client.

TCP_REFRESH_HIT is a 304 reply from the origin server to Squid.

> So it seems that only if the client has the object data,
> the combination 304 "Not modified" and TCP_CLIENT_REFRESH
> ("no-cache pragma") makes sense. Is this right?

Yes.

> The combination 304, TCP_REFRESH_HIT and DIRECT: Does it mean
> that an up-to-date object was fetched from the Squid cache
> after the Squid cache has asked the original server (DIRECT)
> if the object data are up-to-date?

Yes.

---
Henrik Nordstrom
Spare time Squid hacker
Received on Sat Oct 31 1998 - 08:46:48 MST

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