Class CachePolicy

java.lang.Object
com.isomorphic.servlet.CachePolicy

public class CachePolicy extends Object
Provides all standard Cache-Control HTTP header response directives and some presets for most common usages.
  • Field Details

    • NO_CACHE

      public static CachePolicy NO_CACHE
      Standard "no-cache" response directive
    • NO_STORE

      public static CachePolicy NO_STORE
      Standard "no-store" response directive
    • NO_TRANSFORM

      public static CachePolicy NO_TRANSFORM
      Standard "no-transform" response directive
    • MUST_REVALIDATE

      public static CachePolicy MUST_REVALIDATE
      Standard "must-revalidate" response directive
    • PROXY_REVALIDATE

      public static CachePolicy PROXY_REVALIDATE
      Standard "proxy-revalidate" response directive
    • MUST_UNDERSTAND

      public static CachePolicy MUST_UNDERSTAND
      Standard "must-understand" response directive
    • PRIVATE

      public static CachePolicy PRIVATE
      Standard "private" response directive
    • PUBLIC

      public static CachePolicy PUBLIC
      Standard "public" response directive
    • IMMUTABLE

      public static CachePolicy IMMUTABLE
      Standard "immutable" response directive
    • STALE_WHILE_REVALIDATE

      public static CachePolicy STALE_WHILE_REVALIDATE
      Standard "stale-while-revalidate" response directive
    • STALE_IF_ERROR

      public static CachePolicy STALE_IF_ERROR
      Standard "stale-if-error" response directive
    • ISC_DISABLE_CACHE

      public static CachePolicy ISC_DISABLE_CACHE
      Preset combination of "no-cache, max-age=0" response directives to completely disable caching.
    • ISC_DISABLE_SHARED_CACHE

      public static CachePolicy ISC_DISABLE_SHARED_CACHE
      Preset (alias) using "private" response directive to disable shared cache only
    • ISC_PERMANENT_CACHE

      public static CachePolicy ISC_PERMANENT_CACHE
      Preset using "max-age=31536000" (one year) serving as "permanent" caching
  • Method Details

    • MAX_AGE

      public static CachePolicy MAX_AGE(int value)
      Standard "max-age=N" response directive
      Parameters:
      value - int N seconds
    • S_MAXAGE

      public static CachePolicy S_MAXAGE(int value)
      Standard "s-maxage=N" response directive
      Parameters:
      value - int N seconds