org.sapia.cocoon.util
Class HttpCacheHeadersHelper

java.lang.Object
  extended by org.sapia.cocoon.util.HttpCacheHeadersHelper

public class HttpCacheHeadersHelper
extends java.lang.Object

Inspired by snippet on Cocoon wiki.

Author:
yduchesne

Field Summary
static java.lang.String CACHE_CONTROL_HEADER
           
static java.lang.String EXPIRES_HEADER
           
static java.lang.String LAST_MOD_HEADER
           
static java.lang.String PRAGMA_HEADER
           
 
Constructor Summary
HttpCacheHeadersHelper()
           
 
Method Summary
static void setCacheHeaders(org.apache.cocoon.environment.Response resp, java.util.Date lastModified, int cacheForHowManySeconds)
          set headers so that the response is cached for nSeconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAST_MOD_HEADER

public static final java.lang.String LAST_MOD_HEADER
See Also:
Constant Field Values

EXPIRES_HEADER

public static final java.lang.String EXPIRES_HEADER
See Also:
Constant Field Values

CACHE_CONTROL_HEADER

public static final java.lang.String CACHE_CONTROL_HEADER
See Also:
Constant Field Values

PRAGMA_HEADER

public static final java.lang.String PRAGMA_HEADER
See Also:
Constant Field Values
Constructor Detail

HttpCacheHeadersHelper

public HttpCacheHeadersHelper()
Method Detail

setCacheHeaders

public static void setCacheHeaders(org.apache.cocoon.environment.Response resp,
                                   java.util.Date lastModified,
                                   int cacheForHowManySeconds)
set headers so that the response is cached for nSeconds

Parameters:
lastModified - if null, now - 2 seconds is used


Copyright © 2008. All Rights Reserved.