cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <>
Subject Re: logicsheet, cache not being utilized
Date Thu, 16 Nov 2000 16:44:06 GMT
Donald Ball <> wrote:
>On Wed, 15 Nov 2000, David J. Manura wrote:
> > The following code is based on the "samples/xsp" example (logicsheet
> > version) in the distribution.  The main differences are that (1) much 
> > stuff is cut out and (2) page-html.xsl now has a piece of code that eats 
> > CPU cycles.
> >
> > I would think that repetative requests on the below would be returned
> > instantly from the cache.  However, on testing, each request takes about
> > 1500ms to serve, largely due to the presence of (2).  This suggests that
> > page-html.xsl is being applied on every request.  Why isn't cached HTML
> > being served instead?
> >
> > I've tested simply XML / XSL --> HTML generation (i.e. without XSP), and 
> > works fine: It reports "This page was served in 0 milliseconds by Cocoon
> > 1.8."

Geez, you can't win. If we made XSP pages default to fetching from cache, 
users would be up in arms saying "my page is not refreshing". But we don't, 

The whole point is XSP is a Dynamic Content Generator. Therefore it assumes 
that the page needs to be regenerated each time unless you specify 
otherwise. To specify otherwise use:

  public boolean hasChanged (Object context) {
    return false; // or caculate whether page has changed

>because you're passing dynamic data into to the xsp processor each time,
>which requires it to recompile the xsp page.

I was under this misconception for a long time. Actually the xsp processer 
simply assumes that its input won't change unless the file referenced by the 
URL changes (basically it assumes you're using ProducerFromFile), so it 
doesn't recompile each time. The delay comes from the XSLT in the original 

Get Your Private, Free E-mail from MSN Hotmail at

Share information about yourself, create your own public profile at

View raw message