@Header(value="Cache-Control") public class CacheControl extends BasicStringHeader
Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain.
Cache-Control: no-cache
Note that HTTP/1.0 caches might not implement Cache-Control and might only implement Pragma: no-cache (see section 14.32).
Cache directives MUST be passed through by a proxy or gateway application, regardless of their significance to that application, since the directives might be applicable to all recipients along the request/response chain. It is not possible to specify a cache- directive for a specific cache.
Cache-Control = "Cache-Control" ":" 1#cache-directive cache-directive = cache-request-directive | cache-response-directive cache-request-directive = "no-cache" ; Section 14.9.1 | "no-store" ; Section 14.9.2 | "max-age" "=" delta-seconds ; Section 14.9.3, 14.9.4 | "max-stale" [ "=" delta-seconds ] ; Section 14.9.3 | "min-fresh" "=" delta-seconds ; Section 14.9.3 | "no-transform" ; Section 14.9.5 | "only-if-cached" ; Section 14.9.4 | cache-extension ; Section 14.9.6 cache-response-directive = "public" ; Section 14.9.1 | "private" [ "=" <"> 1#field-name <"> ] ; Section 14.9.1 | "no-cache" [ "=" <"> 1#field-name <"> ]; Section 14.9.1 | "no-store" ; Section 14.9.2 | "no-transform" ; Section 14.9.5 | "must-revalidate" ; Section 14.9.4 | "proxy-revalidate" ; Section 14.9.4 | "max-age" "=" delta-seconds ; Section 14.9.3 | "s-maxage" "=" delta-seconds ; Section 14.9.3 | cache-extension ; Section 14.9.6 cache-extension = token [ "=" ( token | quoted-string ) ]
When a directive appears without any 1#field-name parameter, the directive applies to the entire request or response. When such a directive appears with a 1#field-name parameter, it applies only to the named field or fields, and not to the rest of the request or response. This mechanism supports extensibility; implementations of future versions of the HTTP protocol might apply these directives to header fields not defined in HTTP/1.1.
The cache-control directives can be broken down into these general categories:
Constructor and Description |
---|
CacheControl(Object value)
Constructor.
|
CacheControl(String value)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static CacheControl |
of(Object value)
Convenience creator.
|
static CacheControl |
of(Supplier<?> value)
Convenience creator using supplier.
|
assertString, getValue, of, of
assertName, assertValue, canCast, cast, eqIC, equals, getElements, getName, getRawValue, hashCode, isSupplier, of, ofPair, toString, unwrap
public CacheControl(Object value)
public CacheControl(String value)
value
- The header value.public static CacheControl of(Object value)
value
- The header value.
String
CacheControl
object.public static CacheControl of(Supplier<?> value)
Header value is re-evaluated on each call to BasicStringHeader.getValue()
.
value
- The header value supplier.
String
CacheControl
object.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.