-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-template@447536 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
cocoon-template-sample/src/main/resources/COB-INF/view/caching4.jx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" jx:cache-key="abc" jx:cache-validity="${Packages.org.apache.excalibur.source.impl.validity.ExpiresValidity(10000)}"> | ||
<title>JX Caching</title> | ||
<content> | ||
<p> | ||
This content has been generated at <jx:formatDate value="${java.util.Calendar.getInstance().getTime()}" pattern="yyyy-MM-dd HH:mm:ss"/><br/> | ||
</p> | ||
<p> | ||
Caching configuration is <b>jx:cache-key="abc" | ||
jx:cache-validity="$ {Packages.org.apache.excalibur.source.impl.validity.ExpiresValidity(10000)}"</b> | ||
</p> | ||
|
||
<p> | ||
This means that once the content is generated it expires after 10 seconds.<br/> | ||
The cache key is static so there will only be one instance of cached document.<br/> | ||
You may of course mix various cache key generation strategies with different validities.<br/> | ||
</p> | ||
|
||
<p> | ||
You may try to <a href="">reload the page</a> and see if generation date changes.<br/> | ||
You may try to <a href="?foo=bar">define additional request parameters</a> to see that it does not change a thing. | ||
</p> | ||
|
||
<p> | ||
Next sample: none.<br/> | ||
Go <a href="../">back</a> to Cocoon Template samples. | ||
</p> | ||
</content> | ||
</page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters