sgala 02/01/17 03:32:34
Modified: src/java/org/apache/jetspeed/cache/disk
JetspeedDiskCacheEntry.java
src/java/org/apache/jetspeed/services/resources
JetspeedResources.java
webapp/WEB-INF/conf JetspeedResources.properties
Log:
Default expiration interval reconfigured as a property. It enables us to tune it.
For dynamic situations, use something like 30 secs. For static feed, somethings like
15 minutes.
Revision Changes Path
1.30 +11 -3
jakarta-jetspeed/src/java/org/apache/jetspeed/cache/disk/JetspeedDiskCacheEntry.java
Index: JetspeedDiskCacheEntry.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/cache/disk/JetspeedDiskCacheEntry.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- JetspeedDiskCacheEntry.java 3 Jan 2002 19:00:46 -0000 1.29
+++ JetspeedDiskCacheEntry.java 17 Jan 2002 11:32:33 -0000 1.30
@@ -101,12 +101,20 @@
*
*@author <a href="mailto:[EMAIL PROTECTED]">Kevin A. Burton</a>
*@author <a href="mailto:[EMAIL PROTECTED]">Santiago Gala</a>
- *@version $Id: JetspeedDiskCacheEntry.java,v 1.29 2002/01/03 19:00:46 sgala Exp $
+ *@version $Id: JetspeedDiskCacheEntry.java,v 1.30 2002/01/17 11:32:33 sgala Exp $
**/
public class JetspeedDiskCacheEntry implements DiskCacheEntry {
- //FIXME: should be a configurable property (15 min by now)
- private static long defaultExpirationInterval = 15 * 60 * 1000;
+ /**
+ * <p>Expiration interval that will be used it the remote URL does not
+ * specify one. The contract here is:
+ * <ul>
+ * <li>If we have no hits, we will hit our entry every time DiskCacheDaemon is
run to revalidate.</li>
+ * <li>No matter how many hits we get, we will reach our entry at most once per
defaultExpirationInterval.</li>
+ * </ul>
+ */
+ private static long defaultExpirationInterval = 1000 *
+ JetspeedResources.getInt(
JetspeedResources.DEFAULT_DCE_EXPIRATION_TIME_KEY, 15 * 60 );
//Used for Local URL writing
static String encoding = JetspeedResources.getString(
1.9 +9 -2
jakarta-jetspeed/src/java/org/apache/jetspeed/services/resources/JetspeedResources.java
Index: JetspeedResources.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/resources/JetspeedResources.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- JetspeedResources.java 19 Nov 2001 07:51:54 -0000 1.8
+++ JetspeedResources.java 17 Jan 2002 11:32:34 -0000 1.9
@@ -65,7 +65,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rapha�l Luta</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Tom Adams</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Chris Kimpton</a>
- * @version $Id: JetspeedResources.java,v 1.8 2001/11/19 07:51:54 paulsp Exp $
+ * @version $Id: JetspeedResources.java,v 1.9 2002/01/17 11:32:34 sgala Exp $
*/
public class JetspeedResources extends TurbineResources {
@@ -82,7 +82,12 @@
public static final String PORTLETCONTROL_DEFAULT_CLASSNAME_KEY =
"portletcontrol.default.classname";
public static final String PORTLETCONTROL_MAXIMIZED_CLASSNAME_KEY =
"portletcontrol.maximized.classname";
public static final String PORTLETCONTROLLER_DEFAULT_CLASSNAME_KEY =
"portletcontroller.default.classname";
+
+ //Disk Cache (URLManager) parameters
public static final String CACHE_DIRECTORY_KEY = "cache.directory";
+ public static final String CACHE_REQUIRE_CACHED_KEY = "cache.require.cached";
+ public static final String DEFAULT_DCE_EXPIRATION_TIME_KEY =
"cache.default.expiration";
+
public static final String DEFAULTPORTLETCONTROL_WIDTH_KEY =
"defaultportletcontrol.width";
public static final String DEFAULTPORTLETCONTROLLER_NUMCOLUMNS_KEY =
"defaultportletcontroller.numcolumns";
public static final String DEFAULTPORTLETCONTROLLER_WIDTH_KEY =
"defaultportletcontroller.width";
@@ -106,7 +111,6 @@
public static final String NAVIGATIONS_TOP_KEY = "navigations.top";
public static final String NAVIGATIONS_BOTTOM_KEY = "navigations.bottom";
public static final String AUTOCREATE_PORTLETS_KEY = "autocreate.portlets";
- public static final String CACHE_REQUIRE_CACHED_KEY = "cache.require.cached";
public static final String CONTENT_PROVIDER_LIST_KEY = "content.provider.list";
public static final String DEFAULT_TITLE_KEY = "metadata.default.title";
public static final String DEFAULT_DESCRIPTION_KEY =
"metadata.default.description";
@@ -147,5 +151,8 @@
public static final String PATH_SCREEN_KEY = "screen";
public static final String PATH_TEMPLATE_KEY = "template";
public static final String PATH_PANEL_KEY = "select-panel";
+
+
+
}
1.58 +11 -1
jakarta-jetspeed/webapp/WEB-INF/conf/JetspeedResources.properties
Index: JetspeedResources.properties
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/webapp/WEB-INF/conf/JetspeedResources.properties,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- JetspeedResources.properties 10 Jan 2002 08:34:42 -0000 1.57
+++ JetspeedResources.properties 17 Jan 2002 11:32:34 -0000 1.58
@@ -1,7 +1,7 @@
################################################################################
# Jetspeed Configuration
# Author: Kevin A. Burton ([EMAIL PROTECTED])
-# $Id: JetspeedResources.properties,v 1.57 2002/01/10 08:34:42 kimptoc Exp $
+# $Id: JetspeedResources.properties,v 1.58 2002/01/17 11:32:34 sgala Exp $
################################################################################
# This is the main file you will need to configuration Jetspeed. If there are
# any secondary files they will be pointed to from this file.
@@ -58,6 +58,16 @@
#this in the background
#Default: true
cache.require.cached=true
+
+# Default (minimal) expiration time for URLs in seconds.
+# External URL that return a "Expires:" header will use the returned value.
+# This value will be used for those URL that specify "0" or do not have a
+# "Expires:" header.
+# Default: 900 seconds (fifteen minutes).
+cache.default.expiration=900
+
+
+
#########################################
# Temporary Storage #
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>