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