org.sapia.cocoon.acting
Class HttpResponseHeaderAction

java.lang.Object
  extended by 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:

Example Spring configuration:

       
 
Example Sitemap configuration:

                    
          
         
 

Author:
yduchesne

Field Summary
static java.lang.String PARAM_CACHE_VALIDITY_MINUTES
           
static java.lang.String PARAM_CACHE_VALIDITY_SECONDS
           
 
Fields inherited from interface org.apache.cocoon.acting.Action
ROLE
 
Constructor Summary
HttpResponseHeaderAction()
           
 
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
 

Field Detail

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
Constructor Detail

HttpResponseHeaderAction

public HttpResponseHeaderAction()
Method Detail

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.