You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Rune Sandnes <ru...@klapp.no> on 2002/02/22 14:02:40 UTC
C2 caching of XSP?
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)
regards,
Rune,
Trondheim,
Norway
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: C2 caching of XSP?
Posted by "Marcelo F. Ochoa" <mo...@ieee.org>.
Joseph Rajkumar wrote:
>Hi
> We are looking at using Tomcat and Cocoon with
>Apache for a high volume database oriented website. We
>can use either MySQL or PostgreSQL because we are in need
>of transactions.
>
Postgres could be work well because has stored procedure and triggers.
In the other hand DBPrism external cache invalidator do not requires an
Oracle database. For example yould invalidate a Cacheable xsp page with
simple telnet command which sent an HTTP post message like this:
POST /cocoon/x-dbprism-cache-invalidate HTTP/1.0
Authorization: BASIC aW52YWxpZGF0b3I6aW52YWxpZGF0b3I=
Content-Length: 580
<?xml version="1.0"?>
<INVALIDATION VERSION="WCS-1.0">
<OBJECT>
<ADVANCEDSELECTOR URIPREFIX="/cms/" URIEXP="CMSj.content">
<OTHER TYPE="sitemap" NAME="source" VALUE="/Home.xml"/>
<OTHER TYPE="sitemap" NAME="printable" VALUE="no"/>
</ADVANCEDSELECTOR>
<ACTION REMOVALTTL="0"/>
<ADVANCEDSELECTOR URIPREFIX="/cms/" URIEXP="CMSj.header">
<OTHER TYPE="sitemap" NAME="source" VALUE="/Home.xml"/>
<OTHER TYPE="sitemap" NAME="printable" VALUE="no"/>
</ADVANCEDSELECTOR>
<ACTION REMOVALTTL="0"/>
</OBJECT>
</INVALIDATION>
>
>
> How much support is available for MySQL or PostgreSQL
>when we use DBPrism. I know that it supports many version
>of Oracle, but we do not use Oracle.
>
DBPrism is open you could make an adapter for any database which have
stored procedures, but probably for your problem adding only the
external invalidator will be work fine.
>
>
> Thanks for your time.
>
>Thanks
>Joseph Rajkumar
>
Best regards, Marcelo.
PD: I'll make a simple XSP using external cache invalidator server today.
--
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: C2 caching of XSP?
Posted by Joseph Rajkumar <ra...@telocity.com>.
Hi
We are looking at using Tomcat and Cocoon with
Apache for a high volume database oriented website. We
can use either MySQL or PostgreSQL because we are in need
of transactions.
How much support is available for MySQL or PostgreSQL
when we use DBPrism. I know that it supports many version
of Oracle, but we do not use Oracle.
Thanks for your time.
Thanks
Joseph Rajkumar
======================================================================
> 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
> 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
email: rajkumar@telocity.com
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: C2 caching of XSP?
Posted by "Marcelo F. Ochoa" <mo...@ieee.org>.
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>