You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Carles Canellas <cc...@yahoo.es> on 2002/11/07 17:18:31 UTC

Cache problems with cocoon

Hello.
I'm trying to use Forrest as a Webapp aplication, with
Tomcat. It all works OK, except for some cache
problems that are slowing my site too much.

When I call a page for 2ond time, it should be cached.
But as we can see in the logs attached, it is not,
although the 3 aggregated xml (book, tabs and body,
are cached).

Another problem is the evaluation of the xslt just
before the cache validation. In the documents is too
much time consuming, as you can see in the logs.

The third question is why there's a cached book-* and
a cached tab-* for each page in the directory, if
inside the same dir, tabs and book are the same. 

Thanks in advance.
Carles.

DEBUG   (2002-11-07) 17:23.27:752  
[sitemap.transformer.xsltc] (/index.html)
Thread-7/TraxTransformer: Using stylesheet:
'file:/C:/trabajo/forrest-working/build/webapp/skins/my-site/xslt/html/site2xhtml.xsl'
in
org.apache.cocoon.transformation.TraxTransformer@4e80d3
DEBUG   (2002-11-07) 17:23.27:862   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Cached
response not found for 'index.html'.
DEBUG   (2002-11-07) 17:23.27:862   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Cached
response not found for 'index.html'.
DEBUG   (2002-11-07) 17:23.27:862   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Cached
response not found for 'index.html'.
DEBUG   (2002-11-07) 17:23.27:908   [sitemap]
(/index.html) Thread-7/ContentAggregator:
ContentAggregator: generating aggregated content
DEBUG   (2002-11-07) 17:23.27:908  
[sitemap.transformer.xsltc] (/index.html)
Thread-7/TraxTransformer: Using stylesheet:
'file:/C:/trabajo/forrest-working/build/webapp/skins/my-site/xslt/html/book2menu.xsl'
in
org.apache.cocoon.transformation.TraxTransformer@cec87
DEBUG   (2002-11-07) 17:23.27:987   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Found
cached response for 'book-index.xml'.
DEBUG   (2002-11-07) 17:23.27:987   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Using
valid cached content for 'book-index.xml'.
DEBUG   (2002-11-07) 17:23.28:002   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Caching
content for further requests of 'book-index.xml'.
DEBUG   (2002-11-07) 17:23.28:018   [sitemap]
(/index.html) Thread-7/ResourceLimitingPool: Put a
org.apache.cocoon.generation.FileGenerator back into
the pool.
DEBUG   (2002-11-07) 17:23.28:018   [sitemap]
(/index.html) Thread-7/ResourceLimitingPool: Put a
org.apache.cocoon.transformation.TraxTransformer back
into the pool.
DEBUG   (2002-11-07) 17:23.28:018   [sitemap]
(/index.html) Thread-7/ResourceLimitingPool: Put a
org.apache.cocoon.serialization.HTMLSerializer back
into the pool.
DEBUG   (2002-11-07) 17:23.28:018   [sitemap]
(/index.html) Thread-7/ResourceLimitingPool: Put a
org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline
back into the pool.
DEBUG   (2002-11-07) 17:23.28:018  
[sitemap.transformer.xsltc] (/index.html)
Thread-7/TraxTransformer: Using stylesheet:
'file:/C:/trabajo/forrest-working/build/webapp/skins/my-site/xslt/html/tab2menu.xsl'
in
org.apache.cocoon.transformation.TraxTransformer@c125d9
DEBUG   (2002-11-07) 17:23.28:112   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Found
cached response for 'tab-index.xml'.
DEBUG   (2002-11-07) 17:23.28:112   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Using
valid cached content for 'tab-index.xml'.
DEBUG   (2002-11-07) 17:23.28:112   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Caching
content for further requests of 'tab-index.xml'.
DEBUG   (2002-11-07) 17:23.28:112   [sitemap]
(/index.html) Thread-7/ResourceLimitingPool: Put a
org.apache.cocoon.generation.FileGenerator back into
the pool.
DEBUG   (2002-11-07) 17:23.28:112   [sitemap]
(/index.html) Thread-7/ResourceLimitingPool: Put a
org.apache.cocoon.transformation.TraxTransformer back
into the pool.
DEBUG   (2002-11-07) 17:23.28:112   [sitemap]
(/index.html) Thread-7/ResourceLimitingPool: Put a
org.apache.cocoon.serialization.HTMLSerializer back
into the pool.
DEBUG   (2002-11-07) 17:23.28:112   [sitemap]
(/index.html) Thread-7/ResourceLimitingPool: Put a
org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline
back into the pool.
DEBUG   (2002-11-07) 17:23.28:112  
[sitemap.transformer.xsltc] (/index.html)
Thread-7/TraxTransformer: Using stylesheet:
'file:/C:/trabajo/forrest-working/build/webapp/skins/my-site/xslt/html/document2html.xsl'
in
org.apache.cocoon.transformation.TraxTransformer@a7086f
DEBUG   (2002-11-07) 17:23.32:393   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Found
cached response for 'body-index.xml'.
DEBUG   (2002-11-07) 17:23.32:393   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Using
valid cached content for 'body-index.xml'.
DEBUG   (2002-11-07) 17:23.32:393   [sitemap]
(/index.html)
Thread-7/AbstractCachingProcessingPipeline: Caching
content for further requests of 'body-index.xml'.


=====
Carles Canellas.
VicerTec S.L.

_______________________________________________________________
Yahoo! Messenger
Nueva versión: Webcam, voz, y mucho más ¡Gratis! 
Descárgalo ya desde http://messenger.yahoo.es

Re: Cache problems with cocoon

Posted by Carles Canellas <cc...@yahoo.es>.
> I've been doing some experimenting..  How did you
> know when things were
> fixed?  I'd have expected something like this in
> sitemap.log:
> 
> Found cached response for 'index.html'

No, It doesn't cache the html. But the stylesheets are
cached now, althought the message is the same in the
log.
I detect it the raw way: Looking the consuming of CPU
in the server with a configuration an with the other,
and comparing times in the logs.

Now the times are the required ones, so I can afford
not caching the html if the 3 xml and the stylesheets
are cached OK. It's not so time consuming.

Thanks for your interest.


=====
Carles Canellas.
VicerTec S.L.

_______________________________________________________________
Yahoo! Messenger
Nueva versión: Webcam, voz, y mucho más ¡Gratis! 
Descárgalo ya desde http://messenger.yahoo.es

Re: Cache problems with cocoon

Posted by Jeff Turner <je...@apache.org>.
On Fri, Nov 08, 2002 at 06:10:56PM +0100, Carles Canellas wrote:
> Hello, I have solved my caching problems in webapp
> mode.
> The secret was comment that lines in cocoon.xconf
>  <persistent-store
> class="org.apache.cocoon.components.store.JispFilesystemStore"
>                     logger="core.store.persistent">
>     <parameter name="use-cache-directory"
> value="true"/>
>     <parameter name="datafile"
> value="cocoon-cache.dat"/>
>     <parameter name="indexfile"
> value="cocoon-cache.idx"/>
>     <parameter name="order" value="1701"/>
>   </persistent-store>
> 
> And everything worked OK.

I've been doing some experimenting..  How did you know when things were
fixed?  I'd have expected something like this in sitemap.log:

Found cached response for 'index.html'

Whether the Jisp block is in or out, I never see that.  Also, if I add a
marker comment to site2xhtml.xsl:

<xsl:template match="site">
  <xsl:message>## Reapplying site2html.xsl stylesheet</xsl:message>

It prints on Tomcat's stdout on every request.

I added the same <xsl:message> to a stylesheet in Cocoon's documentation
webapp, and it seems to also be reapplied on every request.  Perhaps this
is a C2.1 bug that no-one's noticed yet.. 


--Jeff


> So If somebody is trying to use forrest in dynamic
> way, that's the patch to do (I don't asume it's a
> patch, because in static forrest with CLI perhaps it
> works ok that way)
> 
> 
> 
> =====
> Carles Canellas.
> VicerTec S.L.
> 

Cache problems with cocoon

Posted by Carles Canellas <cc...@yahoo.es>.
Hello, I have solved my caching problems in webapp
mode.
The secret was comment that lines in cocoon.xconf
 <persistent-store
class="org.apache.cocoon.components.store.JispFilesystemStore"
                    logger="core.store.persistent">
    <parameter name="use-cache-directory"
value="true"/>
    <parameter name="datafile"
value="cocoon-cache.dat"/>
    <parameter name="indexfile"
value="cocoon-cache.idx"/>
    <parameter name="order" value="1701"/>
  </persistent-store>

And everything worked OK.

So If somebody is trying to use forrest in dynamic
way, that's the patch to do (I don't asume it's a
patch, because in static forrest with CLI perhaps it
works ok that way)



=====
Carles Canellas.
VicerTec S.L.

_______________________________________________________________
Yahoo! Messenger
Nueva versión: Webcam, voz, y mucho más ¡Gratis! 
Descárgalo ya desde http://messenger.yahoo.es

Re: Cache problems with cocoon

Posted by Jeff Turner <je...@apache.org>.
On Thu, Nov 07, 2002 at 05:18:31PM +0100, Carles Canellas wrote:
> Hello.
> I'm trying to use Forrest as a Webapp aplication, with
> Tomcat. It all works OK, except for some cache
> problems that are slowing my site too much.
> 
> When I call a page for 2ond time, it should be cached.
> But as we can see in the logs attached, it is not,
> although the 3 aggregated xml (book, tabs and body,
> are cached).

Hmm :/  Can't think why that isn't caching the last step.  Forrest's
sitemap certainly isn't configured for runtime speed, but it shouldn't
cause this.

Forrest used to (~7 Oct) print lots of error logs.. something like:
JispStoreException: "no indexes associated with this database".  Then
someone upgraded Cocoon, or something happened, and the errors stopped..

If no-one here has any ideas, perhaps try cocoon-users.


> Another problem is the evaluation of the xslt just
> before the cache validation. In the documents is too
> much time consuming, as you can see in the logs.
> 
> The third question is why there's a cached book-* and
> a cached tab-* for each page in the directory, if
> inside the same dir, tabs and book are the same. 

There are sitemap rules:

 <map:match pattern="**book-**/*.xml">

and 

 <map:match pattern="**tab-**.xml">

So to generate index.html, Cocoon issues an internal request for
tab-index.xml, and that is cached.


--Jeff

> Thanks in advance.
> Carles.
>