cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: bug in caching xsp pages in c1
Date Fri, 26 Jan 2001 23:18:22 GMT
Donald Ball <balld@webslingerZ.com> wrote:
>hey guys. i was fiddling around with some xsp pages, trying to figure out
>what actually calls the hasChanged method on my xsp pages to see if i
>could mess around with the cache key. lo and behold, i find out that the
>hasChanged method isn't called on my xsp pages any longer... ever.
>
>what gives? this is pretty bad news for high traffic xsp sites.

Doh! I started panicking and then realised what the problem was. I quote 
from
http://xml.apache.org/cocoon/xsp.html

-----------------------------------------------------
Also in the <xsp:structure> tag, a <util:cacheable/> tag may be defined. 
This empty tag simply allows the page to be cached. This should always be 
combined with a method declaration as follows:

<xsp:logic>
public boolean hasChanged (Object context) {
            // context is a HttpServletRequest
            return // whether the page has changed.
          }
        </xsp:logic>
-----------------------------------------------------


Now, the question is, why did I change the behaviour like this? (there was a 
similar change regarding Producers and Processors).

Answer: because without some way of marking pages as cacheable, the 
uncacheable pages are always stored in cache, which is a big waste of space.

I did mention this on cocoon-dev before I did it and the consensus was to go 
ahead.

On second thoughts it would probably be better to have a unified 
util:cacheable tag, i.e. require that the hasChanged method be inside the 
util:cacheable tag, so that you are less likely to forget one or the other.



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Mime
View raw message