cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@cocoon.zones.apache.org
Subject [DAISY] Updated: CTemplate
Date Wed, 19 Oct 2005 06:53:22 GMT
A document has been updated:

http://cocoon.zones.apache.org/daisy/documentation/751.html

Document ID: 751
Branch: main
Language: default
Name: CTemplate (unchanged)
Document Type: Simple Document (unchanged)
Updated on: 10/19/05 6:53:03 AM
Updated by: Reinhard Pötz

A new version has been created, state: publish

Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 1942 bytes (previous version: 719 bytes)
Content diff:
(16 equal lines skipped)
    
    <h1>Caching</h1>
    
+++ <p>In order to make the template cacheable, you have to provide two pieces of
+++ information:</p>
+++ 
+++ <ul>
+++ <li>the <strong>cache key</strong></li>
+++ <li>a<strong> validity object</strong></li>
+++ </ul>
+++ 
+++ <p>The validity object has to implement the interface
+++ <tt><a href="http://excalibur.apache.org/apidocs/org/apache/excalibur/source/SourceValidity.html">SourceValidity</a></tt>.
+++ The source validity contains the logic that calculates whether the cached
+++ information is still valid or not. As the output of a template can depend on
+++ many conditions (e.g. request parameters, values of business objects, etc.) a
+++ cache key is also required. The cache key must be a
+++ <tt><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/Serializable.html">Serializeable</a>
+++ </tt>object that <em>identifies </em>a cacheable template output.</p>
+++ 
+++ <p>A short example should demonstrate how this looks like in terms of code:</p>
+++ 
+++ <pre>&lt;page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+++   jx:cache-key="${cocoon.request.getParameter('xyz'}"
+++   jx:cache-validity="${Packages.org.apache.excalibur.source.impl.validity.ExpiresValidity(15
* 60 * 1000)}"&gt;
+++ 
+++   ...
+++ 
+++ &lt;/page&gt;
+++ </pre>
+++ 
+++ <p>Note that both attributes have to be expressions.</p>
+++ 
    </body>
    </html>


Fields
======
no changes

Links
=====
no changes

Custom Fields
=============
no changes

Collections
===========
no changes

Mime
View raw message