You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jonas Lundberg <my...@gmail.com> on 2006/01/14 16:48:03 UTC

Event-aware caching problem

I have a strange problem with event-aware caching using Cocoon 2.1.8.
It works, in the sense that I get cached data. It does not work, in
the sense that each request takes several seconds to compute.

I put pages together by using xinclude, which calls stream.xq, to
compute the contents. As a first step, I wanted to cache the contents
of stream.xq. This process takes 15 seconds, according to the log.

INFO  (2006-01-14) 16:31.29:187 [access] (/cocoon/weblog/)
http-8080-Processor23/CocoonServlet: 'weblog/' Processed by Apache
Cocoon 2.1.8 in 15.281 seconds.

If I make just one call directly to stream.xq, it takes 3-5 seconds:

(/cocoon/sream.xq?streampattern=blogcomment_admin&pageKey=one&imageprefix=../../&id=cocoon&discussion=conferences&url=HHID19/Blipp/12.0&base=diskutera/)
http-8080-Processor25/CocoonServlet: 'twinstreamraw.xq' Processed by
Apache Cocoon 2.1.8 in 3.344 seconds.

My cache setup is as follows:
      <map:pipeline type="event-aware">
      <map:match pattern="flow">
        <map:call function="cacheEvent"/>
      </map:match>

     <map:match pattern="stream.xq">
                    <map:generate type="sample" src="cocoon:/stream.noncached">
                        <map:parameter name="use-request-parameters"
value="true"/>
                      </map:generate>
                     <map:serialize type="xml"/>
      </map:match>
</map:pipeline>

The source of <map:generate type="sample"
src="cocoon:/stream.noncached"> is a call to an xQuery:

<map:match pattern="stream.noncached">
         <map:generate src="xq/stream.xq" type="xquery">
              <map:parameter name="use-request-parameters" value="true"/>
         </map:generate>
<map:serialize type="xml"/>
</map:match>

>From this test, event-aware caching seems pointless.... since
generating the page in the first place, takes this amout of time... so
I guess I have made a mistake somewhere. What could that be? Ideas?
Suggestions? Is the xquery executed even though cached contents are
displayed?

(To generate the event-cache test page in the block sample, goes
somewhat faster:
INFO  (2006-01-14) 16:44.10:843 [access]
(/cocoon/samples/blocks/eventcache/demo?pageKey=one&rand=7534213488853639168)
http-8080-Processor23/CocoonServlet: 'samples/blocks/eventcache/demo'
Processed by Apache Cocoon 2.1.8 in 15 milliseconds.)

I'd be happy for any ideas about what happens here.

Regards
Hans

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org