You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gh...@apache.org on 2003/09/19 00:07:40 UTC
cvs commit: cocoon-2.1/src/webapp/samples/xsp/java cacheable.xsp
ghoward 2003/09/18 15:07:39
Modified: src/webapp/samples/xsp/java cacheable.xsp
Log:
Use new excalibur source validity. Was there any reason to
use the compatibility mode or is this just legacy?
Revision Changes Path
1.2 +4 -5 cocoon-2.1/src/webapp/samples/xsp/java/cacheable.xsp
Index: cacheable.xsp
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/xsp/java/cacheable.xsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cacheable.xsp 7 Sep 2003 06:09:10 -0000 1.1
+++ cacheable.xsp 18 Sep 2003 22:07:39 -0000 1.2
@@ -18,8 +18,7 @@
<xsp:structure>
<xsp:include>org.apache.excalibur.source.SourceValidity</xsp:include>
- <xsp:include>org.apache.cocoon.caching.CacheValidityToSourceValidity</xsp:include>
- <xsp:include>org.apache.cocoon.caching.DeltaTimeCacheValidity</xsp:include>
+ <xsp:include>org.apache.excalibur.source.impl.validity.ExpiresValidity</xsp:include>
<xsp:include>java.io.Serializable</xsp:include>
</xsp:structure>
@@ -28,6 +27,7 @@
// artificial slowdown to make the effects of the cache visible
final int DELAY_SECS = 2;
+ // request parameter "validity" contains number of seconds to cache
private int getValidityFromRequest() {
int result = 15;
try {
@@ -69,8 +69,7 @@
*/
public SourceValidity getValidity() {
// keep in cache for our validity time
- return CacheValidityToSourceValidity.createValidity(
- new DeltaTimeCacheValidity(0, getValidityFromRequest()));
+ return new ExpiresValidity(getValidityFromRequest()*1000);
}
</xsp:logic>
Re: cvs commit: cocoon-2.1/src/webapp/samples/xsp/java cacheable.xsp
Posted by Bertrand Delacretaz <bd...@codeconsult.ch>.
Le Vendredi, 19 sep 2003, à 00:07 Europe/Zurich, ghoward@apache.org a
écrit :
> ... Modified: src/webapp/samples/xsp/java cacheable.xsp
> Log:
> Use new excalibur source validity. Was there any reason to
> use the compatibility mode or is this just legacy?...
Legacy - I updated the sample for 2.1 based on older examples, it
wasn't clear to me which validity mechanism was the "modern" one.
Thanks for fixing this!
-Bertrand