Re: Size of cached Objects?

From: Michael Ju. Tokarev <[email protected]>
Date: Mon, 20 Mar 2000 23:49:46 +0300

Thien Do wrote:
>
> Michael,
[]
> Then I try to use TELNET to connect direct to the WEB server(not via SQUID):
[]
> Set-Cookie: JSESSIONID=To1015mC23804396125737226At;Path=/

Just one thought: with set-cookie, page should be non-cacheable.
See rationale at the bottom.

[]
> The results getting directly from WEB server are quite similar, except that
> one gives 500 lines and another gives 1000 lines as expected. I check the
> header parts, there are no "pragma: no-cache"

I don't know exactly methanism what directs squid to not to cache on-the-fly
generated pages (no-cache is just one possible idea, but perhaps here are others,
and (not directly related, but) Set-Cookie also should do. Recall -- I don't
know exactly, but trivial logic (from server's side, and from cache's side
of view) can help. :)

[]
>
> Now, I try with the SQUID. Look at access.log, it surprises me, because with
> the file size500.jsp, I have:
> 172.17.29.253 - - [20/Mar/2000:11:28:26 -0800] "GET
> http://fang.go.com:2246/jsp/size500.jsp HTTP/1.1" 200 7887 TCP_MISS:DIRECT
> 172.17.29.253 - - [20/Mar/2000:11:28:33 -0800] "GET
> http://fang.go.com:2246/jsp/size500.jsp HTTP/1.1" 200 7836 TCP_MEM_HIT:NONE
> ..... then next hits are: TCP_MEM_HIT:NONE
>
> But with size1000.jsp:
> 172.17.29.253 - - [20/Mar/2000:12:13:00 -0800] "GET
> http://fang.go.com:2246/jsp/size1000.jsp HTTP/1.1" 200 15387 TCP_MISS:DIRECT
> [tdo_dshop] dean 63% 172.17.29.253 - - [20/Mar/2000:12:13:06 -0800] "GET
> http://fang.go.com:2246/jsp/size1000.jsp HTTP/1.1" 200 15248 TCP_MISS:DIRECT
> ..... then next hits are: TCP_MISS:DIRECT
>
> It means the SQUID never caches for the file size1000.jsp, but OK with
> size500.jsp

Uh, here is the problem. And maybe a squid bug!
Note the different size (7836 and 15248). Probably small one cached in memory
some time, while larger one is swapped out as soon as possible. I think that
squid should not cache _both_ of this regardless of size (maybe I'm wrong).
This should be related to object sizes, but _in memory_, not on disk
(not maximum_object_size). Again, I don't know internal squid structures.

You can try this without a java. Just create _static_ pages with that
size (say, 4Kb and 20Kb), and do the same.
I think that only one cause of a problem is a cookie, since headers
looks fine and squid should cache this.
Try both -- and firstly, try to disable cookie requests from your server.
If this solves the trouble and pages will be cached, than it is a
bug in squid (again, see rationale).

Just one rationale about -- why I said that squid should not cache both pages.
Imagine a situation where two users comes to your server in short time.
Server should attempt to "establish a session" with each one, as you use
cookie mechainsm. If both users will get the same contents (with headers,
as squid can cache all or nothing), then your server will think that it is
_one_ "session". Imagine what can happen here if you implement, say, shopping
bag at your server!
With current situation, when at least some pages are cacheable, this is
possible.

Regards,
 Michael.

P.S. All statements here are just my intention that may be wrong.
Received on Mon Mar 20 2000 - 13:52:48 MST

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