org.riotfamily.website.view
Class CacheableViewController
java.lang.Object
org.riotfamily.website.view.ConfigurableViewController
org.riotfamily.website.view.CacheableViewController
- All Implemented Interfaces:
- CacheableController, Controller
- Direct Known Subclasses:
- CacheablePageController
public class CacheableViewController
- extends ConfigurableViewController
- implements CacheableController
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CacheableViewController
public CacheableViewController()
getTimeToLive
public long getTimeToLive()
- The default implementation always returns
CACHE_ETERNALLY
.
- Specified by:
getTimeToLive
in interface CacheableController
getLastModified
public long getLastModified(HttpServletRequest request)
- The default implementation returns
System.currentTimeMillis()
so that the item is
refreshed as soon as it expires.
- Specified by:
getLastModified
in interface CacheableController
bypassCache
protected boolean bypassCache(HttpServletRequest request)
- Whether the cache should be bypassed for the given request. The default
implementation always returns
false
.
getCacheKey
public String getCacheKey(HttpServletRequest request)
- Description copied from interface:
CacheableController
- Returns the key that is used to look up a previously cached version.
The key must include all values that govern the output, such as the
requested URL, parameters, attributes, cookie values or the name of the
controller. The key itself is not interpreted in any way and thus can
have an arbitrary format.
- Specified by:
getCacheKey
in interface CacheableController
appendCacheKey
protected void appendCacheKey(StringBuffer key,
HttpServletRequest request)
- Subclasses may overwrite this method to append values to the cache-key.
The default implementation does nothing.