cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony" <t...@employer.com.br>
Subject RE: XSP: caching?
Date Fri, 04 May 2001 12:44:03 GMT
Donald,

Sorry to insite, but this is critical for me:

To make it simple, this is what I added in all my XSP pages, and my
Cocoon.ini is unchanged since install.
    public boolean hasChanged (Object context) {return false;}
    public boolean isCacheable (HttpServletRequest request) {return true;}

What happen is just one of them appears to be cached (actually the first
page called after Tomcat is started, no matter which one):

...... <!-- This page was served from cache in 10 milliseconds by Cocoon
1.8.2 --> .....

All my XSP pages are asking for cache however this lovely message apprears
just in this one page.I suspect there is a bug in the 1.8.2 cache managment,
and I'll be happy if someone confirm this odd beaviour.

I attached a sample page of my project.


Tony.



> On Thu, 3 May 2001, Tony wrote:
>
> > I tried everything like hasChanged(), isCacheable(), hasTheHellChanged()
> > (just kidding) but no luck so far.
> >
> > In my site, a lot of my XML page elements (dynamic forms and
> so) come from a
> > database. Thus without a proper XSP cache working I'm not going anywere.
> >
> > Could someone give us a simple XSP example on how to make the
> cache work on
> > Cocoon 1.8.2 ?
>
>     static long last_changed_millis = 0;
>     static final long MILLISECONDS_TO_CACHE = 60*1000;
>
>     public boolean hasChanged(Object context) {
>       long current_millis = System.currentTimeMillis();
>       if (current_millis - MILLISECONDS_TO_CACHE &gt;
> last_changed_millis) {
>         last_changed_millis = current_millis;
>         return true;
>       } else {
>         return false;
>       }
>     }
>
>     public boolean isCacheable(HttpServletRequest request) {
>       return true;
>     }
>
> (turns out i was wrong about the signature. look to the source, guys!)
>
> - donald
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>

Mime
View raw message