Class CmsSharedCachePolicy

java.lang.Object
org.opencms.staticexport.CmsSharedCachePolicy

public class CmsSharedCachePolicy extends Object
A cache policy for the shared cache delivery mode.

A policy without a content type is the default policy. Other policies match either an exact content type or a top-level content type wildcard such as image/*.

  • Field Details

  • Constructor Details

  • Method Details

    • getClientMaxAge

      public long getClientMaxAge()
      Returns the maximum client cache age in seconds.

      Returns:
      the maximum client cache age
    • getContentType

      Returns the configured content type selector.

      Returns:
      the content type selector, or null for the default policy
    • getSharedMaxAge

      public long getSharedMaxAge()
      Returns the maximum shared cache age in seconds.

      Returns:
      the maximum shared cache age
    • getStaleIfError

      public long getStaleIfError()
      Returns the stale-if-error duration in seconds.

      Returns:
      the stale-if-error duration, or DURATION_UNSET if it is not configured
    • isDefault

      public boolean isDefault()
      Returns whether this is the default policy.

      Returns:
      true if this is the default policy
    • setClientMaxAge

      public void setClientMaxAge(String clientMaxAge)
      Sets the maximum client cache age in seconds.

      Parameters:
      clientMaxAge - the maximum client cache age
    • setContentType

      public void setContentType(String contentType)
      Sets the content type selector.

      Parameters:
      contentType - the content type selector
    • setSharedMaxAge

      public void setSharedMaxAge(String sharedMaxAge)
      Sets the maximum shared cache age in seconds.

      Parameters:
      sharedMaxAge - the maximum shared cache age
    • setStaleIfError

      public void setStaleIfError(String staleIfError)
      Sets the stale-if-error duration in seconds.

      Parameters:
      staleIfError - the stale-if-error duration