cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Green <>
Subject Caching with XSP (<util:cacheable/>)
Date Tue, 13 Mar 2001 08:52:13 GMT
I'm trying to figure out how to get Cocoon to cache an XSP page (Cocoon 
1.8.2).  I've checked all the documentation, and searched through the 
mail archives, and there is not one single example of a working 
configuration that I can find.  From what I can gather it should cache 
the page if I put the <util:cacheable/> tag withing 
<xsp:structure></xsp:structure>, and if I have a hasChanged(Object 
context) method in the page.  I've tried every combination and placement 
of these that I can think of and nothing works. 

Can someone tell me what I'm missing?  Here is the code for a very bare 
bones page (XML/XSP and XSL) that I'm trying to get to cache.  I'm not 
actually using the XSP to do anything useful, I just need to get it to 
cache so I can use a similar technique on some real pages.

I know that the caching mechanism itself is turned on and working 
because if I comment out all the XSP stuff in the page below, the 
straight XML->(XSL)->HTML transformation is cached. 

<?xml version="1.0"?>

<?cocoon-process type="xsp"?>   

<?cocoon-process type="xslt"?>
<?xml-stylesheet href="cache_test.xsl" type="text/xsl" ?>

<xsp:page language="java" xmlns:xsp=""

         public boolean hasChanged (Object context) {
               return false;

    Cache test

    Here is the body content.



<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet xmlns:xsl="">

<xsl:template match="/page">

       <title><xsl:apply-templates select="title"/></title>
       <h1><xsl:value-of select="title"/></h1>
       <xsl:apply-templates select="bodyContent"/>




I hope someone can tell me what I'm doing wrong here.  I'd really 
appreciate either some pointers on what I've done wrong, or just some 
sample code of one that works.

Thanks in advance,

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