What are the rules for caching?

Daniel O'Callaghan (danny@miriworld.its.unimelb.EDU.AU)
Thu, 1 Dec 1994 06:26:34 +0100

Date: Thu, 1 Dec 1994 06:26:34 +0100
Message-Id: <Pine.3.89.9411291249.A14228-0100000@miriworld.its.unimelb.edu.au>
From: "Daniel O'Callaghan" <danny@miriworld.its.unimelb.EDU.AU>
To: Multiple recipients of list <www-proxy@www0.cern.ch>
Subject: What are the rules for caching?

I've been keeping an eye on our cache stats since I wrote my little script
and I've noticed that only about 50% of data fetched through our proxy
actually ends up in the cache.

For example, the following is this week up to midnight last night,

Thu Dec 1 03:10:04 EST 1994
Cache statistics for the period 27/Nov/1994:07:14:02 to 01/Dec/1994:00:05:28
------------------------------------------------------------------------
Requests Bytes
External Fetches : 9828 260854803
Fetches from cache : 2455 21206371
Total requests : 12283
Percentage cache hit rate: 20.0 % hits, 7.5 % bytes

45716 kB /cwis/wwwcache/ftp
17797 kB /cwis/wwwcache/gopher
208969 kB /cwis/wwwcache/http
Total in cache: 272,482 kB

and for today:
Cache statistics for the period 27/Nov/1994:07:14:02 to 01/Dec/1994:16:03:07
------------------------------------------------------------------------
Requests Bytes
External Fetches : 11926 339676009
Fetches from cache : 2973 26569624
Total requests : 14899 366245633
Percentage cache hit rate : 20.0 % hits, 7.3 % bytes

54779 kB /cwis/wwwcache/ftp
18590 kB /cwis/wwwcache/gopher
231658 kB /cwis/wwwcache/http
Total in cache: 305,027 kB

Bytes fetched externally (not from cache) since midnight last night is
339,676,009 - 260,854,803 = 78,821,206

Cache increase since midnight last night: 32,545 kB

That leaves 46 MB retrieved but not cached :-)

Can anyone suggest why this is happening, and/or a fix for it.
Henrik, can you suggest where I could add a log for items which are
fetched but not cached, with the reason.
We do have NoCaching rules for local hosts, but I don't count those entries
when I generate the statistics shown above.

I know that HTTP/0.9 requests are not cached. What about gopher0?
If gopher0 is cached, can HTTP/0.9 be cached similarly to gopher0?
Surely the proxy can detect that the remote server hands out an HTTP/0.9
document, and can write a pseudo-mime header for the copy in the cache.

I might see if I can modify a robot to go through a list of known http
server and check them for HTTP/1.0

Anyone else have any thoughts?

Danny