cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcelo F. Ochoa" <moc...@ieee.org>
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
>options:
>
>1. Do a test in the xsp to check if the database has been changed, and
>then
>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
>possible)
>
>
 You could use DBPrism External Cache Invalidator Server.
 This server use ESI (http://www.w3.org/TR/esi-invp) 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 
asap.
  You could find more information about the flowmap of this process at: 
http://www.dbprism.com.ar/dbprism/doc/cms/CMS-WebCache.html
  also internal information about the External Cache Invalidator Server 
interface for Cocoon 2: 
http://www.dbprism.com.ar/dbprism/doc/xdocs/Server.html
  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(
            this.source,this.parameters,null);
        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 - mochoa@ieee.org
Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
More info?
Chapter 21 of the book "Professional XML Databases" (Wrox Press 
http://www.wrox.com/)
Chapter 8 of the book "Oracle & Open Source" (O'Reilly 
http://www.oreilly.com/catalog/oracleopen/)
-----------------------------------------------
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. <http://xml.apache.org/cocoon/faqs.html>

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


Mime
View raw message