Title: RE: How do i cache a JSP on the proxy?
what about
 
<%
 
    if (     (System.currentTimeMillis()/1000) % 15     )
        counter = 0 ;
%>
 
    That is, you first make sure that the time is rounded down to closest second and see if that is divisable by 15, and then resetting counter....
 
Or did I completely misunderstand you?
 
Johan

 
Sent: Saturday, June 09, 2001 12:03 AM
Subject: RE: How do i cache a JSP on the proxy?

Yes.  Oscache provides a proxy independent caching solution.  This is nice and once can have programtically control over the caching.  The only drawback(or good for some one) in the current implementation is all caching is memory based.  All the caching is done in memory and optionally file.

Kesav Kumar
Software Engineer
Voquette, Inc.
650 356 3740
mailto:[EMAIL PROTECTED]
http://www.voquette.com
Voquette...Delivering Sound Information


-----Original Message-----
From: Stan Ng [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 12:15 PM
To: Orion-Interest
Subject: Re: How do i cache a JSP on the proxy?


This is slightly off-topic, but you may want to look into OpenSymphony's
OSCache module.  It provides a variety of caching options for JSP and it's
been working great for us here.


----- Original Message -----
From: "Eduard Witteveen" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Friday, June 08, 2001 7:22 AM
Subject: How do i cache a JSP on the proxy?


> Hello,
>
> I want to cache a jsp page on the proxy (apache).
>
> My current setup is that i have apache running on port 80, with following
config:
> <VirtualHost 145.58.67.8>
>     ServerName eduard.omroep.nl
>     ServerAlias eduard
>     ErrorLog /var/proxy/logs/errors
>     CustomLog /var/proxy/logs/access common
>
>     ProxyPass / http://localhost:8080/
>     CacheRoot "/tmp/proxy"
> </VirtualHost>
>
> Furthermore the orionserver is running on port 8080, and has the following
'special' settings:
> <frontend host="eduard.omroep.nl" port="80" />
>
> For the testing purposes i have the following jsp page:
> <%@ page session="false" %>
> <%! int counter = 0; %>
> <%!
>         // return a time back, which is +15 seconds..
>         public long getLastModified(HttpServletRequest request) {
>                 System.out.println("in last modified");
>                 // return 15 seconds..
>                 return System.currentTimeMillis() * (15 * 1000) ;
>         }
> %>
>
> <%
>     long seconds = 15;
>     long now = System.currentTimeMillis();
>     long expires = now + (seconds * 1000);
>
>     response.setDateHeader("Expires", expires);
>         System.out.println("in source.." + now + "->" +  expires);
> %>
> <html>
> <body>
> <p>This page was generated on time:<%= now %><br />
> Will expire at:<%= expires %><br />
> Expire time in seconds:<%= seconds %><br />
> Count:<%= counter++ %></p>
> </body>
> </html>
>
> Everytime i request the page, the counter is increased, but this is not
what i want. I want to increased at an maximum of 1 time in the 15 seconds.
> Can somebody help me how to accomplish this, or possible otherways to
cache the jsp pages on the front proxy?
>
> greatings,
>
> --
> Eduard Witteveen Systeem Ontwikkelaar
> NOS Internet,  Mediacentrum Kamer 203
> +31(0)356773059 http://www.omroep.nl/
>
> Sed quis custodiet ipsos custodes? : The sixth Satire from Juvenal

Reply via email to