org.riotfamily.cachius.spring
Interface CacheableController

All Superinterfaces:
Controller
All Known Implementing Classes:
AbstractCacheableController, AbstractMinifyController, AbstractResourceController, ButtonStylesheetController, CacheablePageController, CacheableViewController, CssTemplateController, JoiningResourceController, MinifyCssController, MinifyScriptController, ResourceController, SiteListController, Txt2ImgController

public interface CacheableController
extends Controller

Controllers that want their output to be cached must implement this interface.


Field Summary
static long CACHE_ETERNALLY
           
 
Method Summary
 String getCacheKey(HttpServletRequest request)
          Returns the key that is used to look up a previously cached version.
 long getLastModified(HttpServletRequest request)
          Returns the date (as timestamp) when the content was modified for the last time.
 long getTimeToLive()
          Returns the time in milliseconds that has to be elapsed since the last up-to-date check before another check is performed.
 
Methods inherited from interface org.springframework.web.servlet.mvc.Controller
handleRequest
 

Field Detail

CACHE_ETERNALLY

static final long CACHE_ETERNALLY
See Also:
Constant Field Values
Method Detail

getCacheKey

String getCacheKey(HttpServletRequest request)
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.


getTimeToLive

long getTimeToLive()
Returns the time in milliseconds that has to be elapsed since the last up-to-date check before another check is performed. Implementors may return CACHE_ETERNALLY to indicate that the content should be cached eternally.


getLastModified

long getLastModified(HttpServletRequest request)
                     throws Exception
Returns the date (as timestamp) when the content was modified for the last time. The controller will not be executed unless this date is newer than the timestamp of the cached version.

Throws:
Exception