RE: Size of cached Objects?

From: Thien Do <thien.do@dont-contact.us>
Date: Mon, 20 Mar 2000 12:18:28 -0800

Michael,

Thanks a lot for your reply.

> Squid shouldn't interpret in any way contents of pages it caching.
> So you can write absolutely _anything_ inside your page/script,
> and it will be cached (or not) without any contents changes.

I understand this point. I am using Squid as an accelerator-cacher of the
Tomcat, a JSP/servlet engine of Apache group.

Actually I made two jsp files with different names in THE SERVER SIDE:
 * size500.jsp
        <html><head><title>TEST SIZE</title>
      </head><body>
      <UL><H1>
      <%
           for (int i=1; i<1000; i++) {
             out.println("<LI>Line [" + i + "]");
         }
       %>
       </UL></H1>
       </body></html>

And the size1000.jsp:
       <html><head><title>TEST SIZE</title>
       </head><body>
       <UL><H1>
       <%
           for (int i=1; i<1000; i++) {
             out.println("<LI>Line [" + i + "]");
         }
       %>
       </UL></H1>
       </body></html>

> I think that when your page generated by server (is this script
> runs on server, not client?), server refuses to set proper
> "date", "expires", etc fields, but instead generates something
> like "pragma: no-cache". This is true for _all_ server-generated
> pages unless implicitly said by "page generator", be this perl-generated
> pages, "shtml" pages, php etc etc, since (generic) server can't know

Then I try to use TELNET to connect direct to the WEB server(not via SQUID):
  %telnet <WEB servername> <port>
   ...
   GET /jsp/size500.jsp HTTP/1.0
  
HTTP/1.0 200 OK
Set-Cookie2:
JSESSIONID=To1015mC23804396125737226At;Version=1;Discard;Path="/"
Set-Cookie: JSESSIONID=To1015mC23804396125737226At;Path=/
Date: Mon, 20 Mar 2000 19:58:30 GMT
Status: 200
Content-Type: text/html
Servlet-Engine: Tomcat Web Server/3.1M1 (JSP 1.1; Servlet 2.2; Java 1.2.2;
SunOS 5.6 sparc; java.vendor=Sun Microsystems Inc.)

<html>
<head>
<title>TEST SIZE</title>
</head>
<body>
<H1><UL>
<LI>Line [1]
......
<LI>Line [499]
</UL></H1>
</body>
</html>

Then Try with size1000.jsp, the result:
GET /jsp/size10.jsp HTTP/1.0

HTTP/1.0 200 OK
Set-Cookie2:
JSESSIONID=To1016mC6152717983976648At;Version=1;Discard;Path="/"
Set-Cookie: JSESSIONID=To1016mC6152717983976648At;Path=/
Date: Mon, 20 Mar 2000 19:59:36 GMT
Status: 200
Content-Type: text/html
Servlet-Engine: Tomcat Web Server/3.1M1 (JSP 1.1; Servlet 2.2; Java 1.2.2;
SunOS 5.6 sparc; java.vendor=Sun Microsystems Inc.)

<html>
<head>
<title>TEST SIZE</title>
</head>
<body>
<H1><UL>
<LI>Line [1]
...
<LI>Line [999]
</UL></H1>
</body>
</html>

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"

> if contents will be different on next run.
> And also I think that this is not in squid's side -- you can set/change
> any parameters in squid, and this can't 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

Many thanks again for your deatiled explanation.
Regards,
tdo-

============================================================================
==========
Thien Do wrote:
>
> Thanks for reply. I did increase the size of "maximum_object_size" but it
> did not help.
> But ...
> <%
> out.println("<H1><UL>");
> for (int i=1; i<500; i++) {
> out.println("<LI>Line [" + i + "]");
> }
> out.println("</UL></H1>");
> %>
>
> This script generate 500 lines, the page is cached well. If I change 500
to
> 1000, Squid refuses to cache the page. But the 1000-line file is just
about
> few Kbytes, the default of "maximum_object_size" is 4MB.
>
> Seem to be something very simple but I miss out. Can I include the
> squid.conf if you want to help.
>
> tdo-
> <<squid.conf>>
> -----Original Message-----
> From: Kendall Lister [mailto:kendall@charon.net.au]
> Sent: Friday, March 17, 2000 4:29 PM
> To: Squid Users Mailing List
> Subject: Re: Size of cached Objects?
>
> On Fri, 17 Mar 2000, Thien Do wrote:
>
> > In the squid.conf, I understand that maximun_object_size is 4MB by
> > default. What should I do to have big file being cached?
>
> Increase the maximum_object_size value...
>
> --
> Kendall Lister, Systems Operator for Charon I.S. - kendall@charon.net.au
> Charon Information Services - Friendly, Cheap Melbourne ISP: 9589 7781
>
>
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
--------------------------------------------
> Name: squid.conf
> squid.conf Type: unspecified type (application/octet-stream)
> Encoding: quoted-printable
Received on Mon Mar 20 2000 - 13:27:53 MST

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