public interface CacheHelper
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTR_CACHE_MAPPED_SERVLET_NAME |
static String |
ATTR_CACHE_MAPPED_URL_PATTERN |
static int |
TIMEOUT_VALUE_NOT_SET |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Stop the helper from active use
|
String |
getCacheKey(javax.servlet.http.HttpServletRequest request)
getCacheKey: generate the key to be used to cache this request
|
int |
getTimeout(javax.servlet.http.HttpServletRequest request)
get timeout for the cached response.
|
void |
init(javax.servlet.ServletContext context,
Map<String,String> props)
initialize the helper
|
boolean |
isCacheable(javax.servlet.http.HttpServletRequest request)
isCacheable: is the response to given request cachebale?
|
boolean |
isRefreshNeeded(javax.servlet.http.HttpServletRequest request)
isRefreshNeeded: is the response to given request be refreshed?
|
static final String ATTR_CACHE_MAPPED_SERVLET_NAME
static final String ATTR_CACHE_MAPPED_URL_PATTERN
static final int TIMEOUT_VALUE_NOT_SET
void init(javax.servlet.ServletContext context,
Map<String,String> props)
throws Exception
context - the web application context this helper belongs toException - if a startup error occursString getCacheKey(javax.servlet.http.HttpServletRequest request)
request - incoming HttpServletRequest objectboolean isCacheable(javax.servlet.http.HttpServletRequest request)
request - incoming HttpServletRequest objecttrue if the response could be cached. or
false if the results of this request must not be cached.boolean isRefreshNeeded(javax.servlet.http.HttpServletRequest request)
request - incoming HttpServletRequest objecttrue if the response needs to be refreshed.
or return false if the results of this request
don't need to be refreshed.int getTimeout(javax.servlet.http.HttpServletRequest request)
request - incoming HttpServletRequest objectCopyright © 2019. All rights reserved.