org.apache.wicket.request.resource.caching
Class AbstractResourceCachingStrategy
java.lang.Object
org.apache.wicket.request.resource.caching.AbstractResourceCachingStrategy
- All Implemented Interfaces:
- IResourceCachingStrategy
- Direct Known Subclasses:
- FilenameWithTimestampResourceCachingStrategy, QueryStringWithTimestampResourceCachingStrategy
public abstract class AbstractResourceCachingStrategy
- extends Object
- implements IResourceCachingStrategy
base class for resource caching strategies
- provides cached access to the last-modified timestamp
- Author:
- Peter Ertl
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TIMESTAMP_KEY
protected static final MetaDataKey<Map<ResourceReference,Time>> TIMESTAMP_KEY
- timestamp cache stored in request cycle meta data (request-scoped)
AbstractResourceCachingStrategy
public AbstractResourceCachingStrategy()
isLastModifiedCacheEnabled
public boolean isLastModifiedCacheEnabled()
- returns if caching if lastModified timestamp lookup is enabled
- Returns:
true
if enabled
setLastModifiedCacheEnabled
public void setLastModifiedCacheEnabled(boolean enabled)
- controls request-scoped caching of lookups to last modified time of the resource reference
- Parameters:
enabled
-
getLastModified
protected Time getLastModified(ResourceReference resourceReference)
- That method gets the last modification timestamp from the specified resource reference.
The timestamp is cached in the meta data of the current request cycle to eliminate repeated
lookups of the same resource reference which will harm performance.
- Parameters:
resourceReference
- resource reference
- Returns:
- last modification timestamp or
null
if no timestamp provided
Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.