Class ServerCacheControl

    • Field Detail

      • EMPTY

        public static final ServerCacheControl EMPTY
        An empty instance with all directives disabled.
      • DISABLED

        public static final ServerCacheControl DISABLED
        "no-cache, no-store, must-revalidate".
      • REVALIDATED

        public static final ServerCacheControl REVALIDATED
        "no-cache, must-revalidate".
      • IMMUTABLE

        public static final ServerCacheControl IMMUTABLE
        "max-age=31536000, public, immutable".
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Description copied from class: CacheControl
        Returns true if all directives are disabled.
        Overrides:
        isEmpty in class CacheControl
      • cachePublic

        public boolean cachePublic()
        Returns whether the "public" directive is enabled.
      • cachePrivate

        public boolean cachePrivate()
        Returns whether the "private" directive is enabled.
      • immutable

        public boolean immutable()
        Returns whether the "immutable" directive is enabled.
      • mustRevalidate

        public boolean mustRevalidate()
        Returns whether the "must-revalidate" directive is enabled.
      • proxyRevalidate

        public boolean proxyRevalidate()
        Returns whether the "proxy-revalidate" directive is enabled.
      • sMaxAgeSeconds

        public long sMaxAgeSeconds()
        Returns the value of the "s-maxage" directive or -1 if disabled.
      • asHeaderValue

        public String asHeaderValue()
        Description copied from class: CacheControl
        Encodes the directives in this CacheControl into an HTTP "cache-control" header value.
        Specified by:
        asHeaderValue in class CacheControl
        Returns:
        the "cache-control" header value, or an empty string if no directives were enabled.