org.sapia.cocoon.acting
Class HttpResponseHeaderAction
java.lang.Object
org.sapia.cocoon.acting.HttpResponseHeaderAction
- All Implemented Interfaces:
- org.apache.cocoon.acting.Action
public class HttpResponseHeaderAction
- extends java.lang.Object
- implements org.apache.cocoon.acting.Action
This action is inspired by a snippet on the Cocoon wiki.
One can use this action to set the response headers that will trigger caching on the browser-side. This allows static
or seldomly changing content to be shielded from unnecessary requests from browsers. This greatly improves Cocoon scalability
(and user-perceived performance).
This action takes either one of the following sitemap configuration parameters:
cache-validity-seconds: the number of seconds that the browser should keep the resource for
in its cache (defaults to 0).
cache-validity-minutes: the number of minutes that the browser should keep the resource for
in its cache (defaults to 0).
Example Spring configuration:
Example Sitemap configuration:
- Author:
- yduchesne
| Fields inherited from interface org.apache.cocoon.acting.Action |
ROLE |
|
Method Summary |
java.util.Map |
act(org.apache.cocoon.environment.Redirector redirector,
org.apache.cocoon.environment.SourceResolver resolver,
java.util.Map objectModel,
java.lang.String src,
org.apache.avalon.framework.parameters.Parameters parameters)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PARAM_CACHE_VALIDITY_SECONDS
public static final java.lang.String PARAM_CACHE_VALIDITY_SECONDS
- See Also:
- Constant Field Values
PARAM_CACHE_VALIDITY_MINUTES
public static final java.lang.String PARAM_CACHE_VALIDITY_MINUTES
- See Also:
- Constant Field Values
HttpResponseHeaderAction
public HttpResponseHeaderAction()
act
public java.util.Map act(org.apache.cocoon.environment.Redirector redirector,
org.apache.cocoon.environment.SourceResolver resolver,
java.util.Map objectModel,
java.lang.String src,
org.apache.avalon.framework.parameters.Parameters parameters)
throws java.lang.Exception
- Specified by:
act in interface org.apache.cocoon.acting.Action
- Throws:
java.lang.Exception
Copyright © 2008. All Rights Reserved.