cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcelo F. Ochoa" <>
Subject Re: C2 caching of XSP?
Date Fri, 22 Feb 2002 13:56:27 GMT
Rune Sandnes wrote:

>I'm a bit nervous for our rollout of a site with anticipated high volume
>using C2.
>I'm not sure the caching system will help us, at least not what I have
>looked at so far. 
>Our pipeline is like this:
>   <map:match pattern="*/*/">
>    <map:generate type="serverpages" src="contentgen.xsp">
>        <map:parameter name="loc" value="{1}"/>
>        <map:parameter name="id" value="{2}"/>
>    </map:generate>
>    <map:act type="ex-get-stylesheet">
>       <map:parameter name="id" value="{2}"/>
>       <map:parameter name="location" value="{1}"/>
>       <map:transform src="stylesheets/{stylesheet}"/>
>    </map:act>
>    <map:serialize type="html"/>
>   </map:match>
>The xsp does ESQL-calls and gets the XML content from the database.
>The "ex-get-stylesheet" action gets the corrects stylesheet for the
>document, based on location or per-document settings (All this is 
>configurable from the CMS interface)
>Is there any way we can cache this pipeline? I can think of three
>1. Do a test in the xsp to check if the database has been changed, and
>somehow signal that to the caching system.
>2. Check the return from the xsp to see if transformation is needed. 
>3. Use squid or similar. (But I would try to keep this within Cocoon if
 You could use DBPrism External Cache Invalidator Server.
 This server use ESI ( invalidation 
protocol for caching coherence betwen the database server and cocoon.
  In that case you could synchronize the XSP with a simple stored 
procedure or other process which sent and HTTP message to Cocoon's 
invalidator server.
  This componenent is part of DBPrism, but I'll donate through bugzilla 
  You could find more information about the flowmap of this process at:
  also internal information about the External Cache Invalidator Server 
interface for Cocoon 2:
  In your XSP pages you has to override these methods:

  * Generate the unique key.
  * This key must be unique inside the space of this component.
  * @return The generated key hashes the src
  public long generateKey() {
        this.encodedURL = cacheServer.encodeURL(
        return cacheServer.generateKey(this.encodedURL);

  * Generate the validity object.
  * @return The generated validity object or <code>null</code> if the
  *         component is currently not cacheable.
  public CacheValidity generateValidity() {
      return new ExternalCacheValidity(this.generateKey(), this.encodedURL);

  If you have any question about this component sent me an email.
  Best regards, Marcelo.

Marcelo F. Ochoa -
Do you Know DB Prism? Look @
More info?
Chapter 21 of the book "Professional XML Databases" (Wrox Press
Chapter 8 of the book "Oracle & Open Source" (O'Reilly
Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
Paraje Arroyo Seco - Campus Universitario
(7000) Tandil - Bs. AS. - Argentina
Te: +54-2293-444430 Fax: +54-2293-444431

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message