cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Hartle <>
Subject Re: Caching design issue
Date Sat, 16 Jun 2001 22:16:42 GMT
giacomo wrote:

>> - Using <map:match type="regexp" pattern="..."> and
>> <map:parameter>-tags, I made an XSP-page which takes the parameters and
>> generates SVG for navigational images, effectively turning a URI like
>> /image/navigation/black/white/Cocoon%202.jpg into an JPEG image with a
>> black "Cocoon 2" text on a white background; it worked perfectly,
>> changing the colors or the text changes the resulting images. Sadly, the
>> caching performance is nonexistant, as there is just one cached stream
>> result per pipeline instead of one cached stream result per URL per
>> pipeline; I am currently looking for easy ways to resolve this design
>> issue and I would be happy to hear any ideas.
> XSP are by default NOT cacheable. I wasn't aware of the fact that the
> util logicsheet has a cacheable element. I've made a caching logicsheet

XSP is by default not cachable, I agree; I forgot mentioning that I am 
using the following
snippet in the XSP to enable caching as it was done by the aggregate.xsp 

        * Generate the validity object.
        * @return The generated validity object or <code>null</code> if the
        *         component is currently not cacheable.
       public org.apache.cocoon.caching.CacheValidity generateValidity() {
           java.util.HashMap map = new java.util.HashMap();
           map.put("foreground", parameters.getParameter("foreground", 
           map.put("background", parameters.getParameter("background", 
           map.put("level", parameters.getParameter("level", "1"));
           map.put("state", parameters.getParameter("state", "ended"));
           map.put("text", parameters.getParameter("text", ""));
           return new 

As you can see, it is made cachable depending on parameters that are 
determined at
sitemap level -  I am taking them out of the URL the XSP is accessed 
with using a regexp
matcher in the sitemap. I have further tested my changes in 
concerning caching multiple results of one source being accessed via 
different URLs, and
I am getting a performance improvement; the log output shows its 
working, too.

Whom shall I send a diff of with my small 
changes for review
and integration ? Whats the standard procedure at this point ?


To unsubscribe, e-mail:
For additional commands, email:

View raw message