public class ERXWOResponseCache extends Object
ERXWOResponseCache.Cacheable
interface and
should look like this:
public class DirectAction extends WODirectAction implements ERXWOResponseCache.Cacheable {
static {
ERXWOResponseCacheKeyPolicy.sharedInstance().createPolicyEntryForClass(DirectAction.class,
new NSArray(new Object[] {"default", "cached"}),
NSArray.EmptyArray, NSArray.EmptyArray, NSArray.EmptyArray);
}
public DirectAction(WORequest aRequest) {
super(aRequest);
}
public WOActionResults notCachedAction() {
return pageWithName("NotCached");
}
public WOActionResults cachedAction() {
return pageWithName("Cached");
}
public WOActionResults defaultAction() {
return pageWithName("Main");
}
}
You must also set the default er.extensions.ERXWOResponseCache.Enabled=true
for the cache to get used.Name | Description |
---|---|
er.extensions.ERXWOResponseCache.Enabled | er.extensions.ERXWOResponseCache.Enabled |
Modifier and Type | Class and Description |
---|---|
static interface |
ERXWOResponseCache.Cacheable |
static interface |
ERXWOResponseCache.Policy |
Modifier and Type | Field and Description |
---|---|
protected Map |
cache |
protected Boolean |
isEnabled |
static String |
NO_CACHE_KEY
Header key you can set in the response when creating an error page you don't want to get cached.
|
protected ERXWOResponseCache.Policy |
policy |
protected static ERXWOResponseCache |
sharedInstance
Holds a reference to the shared instance
|
Constructor and Description |
---|
ERXWOResponseCache() |
Modifier and Type | Method and Description |
---|---|
boolean |
actionNameIsCachableForClass(Class actionClass,
String actionName) |
WOResponse |
cachedResponseForRequest(Class actionClass,
String actionName,
WORequest request) |
void |
cacheResponseForRequest(Class actionClass,
String actionName,
WORequest request,
WOResponse response) |
void |
flushCache() |
boolean |
hasPolicy() |
boolean |
isEnabled() |
ERXWOResponseCache.Policy |
policy() |
void |
setIsEnabled(boolean enabled) |
void |
setPolicy(ERXWOResponseCache.Policy policy) |
static ERXWOResponseCache |
sharedInstance()
Gets the shared instance
|
protected static ERXWOResponseCache sharedInstance
public static String NO_CACHE_KEY
protected Map cache
protected ERXWOResponseCache.Policy policy
protected Boolean isEnabled
public static ERXWOResponseCache sharedInstance()
public boolean isEnabled()
public void setIsEnabled(boolean enabled)
public ERXWOResponseCache.Policy policy()
public void setPolicy(ERXWOResponseCache.Policy policy)
public boolean hasPolicy()
public boolean actionNameIsCachableForClass(Class actionClass, String actionName)
public void flushCache()
public WOResponse cachedResponseForRequest(Class actionClass, String actionName, WORequest request)
public void cacheResponseForRequest(Class actionClass, String actionName, WORequest request, WOResponse response)
Copyright © 2002 – 2024 Project Wonder.