Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​Net.​Http.​Headers.​CacheControlHeaderValue
Assembly: Microsoft.Net.Http.Headers
Inheritance: object → CacheControlHeaderValue
Represents the <c>Cache-Control</c> HTTP header.
Fields and Constants
public static readonly
string
PublicString
A constant for the <c>public</c> cache-control directive.
public static readonly
string
PrivateString
A constant for the <c>private</c> cache-control directive.
public static readonly
string
MaxAgeString
A constant for the <c>max-age</c> cache-control directive.
public static readonly
string
SharedMaxAgeString
A constant for the <c>s-maxage</c> cache-control directive.
public static readonly
string
NoCacheString
A constant for the <c>no-cache</c> cache-control directive.
public static readonly
string
NoStoreString
A constant for the <c>no-store</c> cache-control directive.
public static readonly
string
MaxStaleString
A constant for the <c>max-stale</c> cache-control directive.
public static readonly
string
MinFreshString
A constant for the <c>min-fresh</c> cache-control directive.
public static readonly
string
NoTransformString
A constant for the <c>no-transform</c> cache-control directive.
public static readonly
string
OnlyIfCachedString
A constant for the <c>only-if-cached</c> cache-control directive.
public static readonly
string
MustRevalidateString
A constant for the <c>must-revalidate</c> cache-control directive.
public static readonly
string
ProxyRevalidateString
A constant for the <c>proxy-revalidate</c> cache-control directive.
Properties
public
bool
NoCache
Gets or sets a value for the <c>no-cache</c> directive.
<para>
Configuring no-cache indicates that the client must re-validate cached responses with the original server
before using it.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.1.4" /> .
public
System.​Collections.​Generic.​ICollection<​Extensions.​Primitives.​StringSegment>
NoCacheHeaders
Gets a collection of field names in the "no-cache" directive in a cache-control header field on an HTTP response.
public
bool
NoStore
Gets or sets a value for the <c>no-store</c> directive.
<para>
Configuring no-store indicates that the response may not be stored in any cache.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.1.5" /> .
public
System.​TimeSpan?
MaxAge
Gets or sets a value for the <c>max-age</c> directive.
<para>
max-age specifies the maximum amount of time the response is considered fresh.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.1.1" /> .
public
System.​TimeSpan?
SharedMaxAge
Gets or sets a value for the <c>s-maxage</c> directive.
<para>
Overrides <see cref="P:Microsoft.Net.Http.Headers.CacheControlHeaderValue.MaxAge">max-age</see>, but only for shared caches (such as proxies).
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.2.9" /> .
public
bool
MaxStale
Gets or sets a value that determines if the <c>max-stale</c> is included.
<para>
<c>max-stale</c> that the client will accept stale responses. The maximum tolerance for staleness
is specified by <see cref="P:Microsoft.Net.Http.Headers.CacheControlHeaderValue.MaxStaleLimit" />.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.1.2" /> .
public
System.​TimeSpan?
MaxStaleLimit
Gets or sets a value for the <c>max-stale</c> directive.
<para>
Indicates the maximum duration an HTTP client is willing to accept a response that has exceeded its expiration time.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.1.2" /> .
public
System.​TimeSpan?
MinFresh
Gets or sets a value for the <c>min-fresh</c> directive.
<para>
Indicates the freshness lifetime that an HTTP client is willing to accept a response.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.1.3" /> .
public
bool
NoTransform
Gets or sets a value for the <c>no-transform</c> request directive.
<para>
Forbids intermediate caches or proxies from editing the response payload.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.1.6" /> .
public
bool
OnlyIfCached
Gets or sets a value for the <c>only-if-cached</c> request directive.
<para>
Indicates that the client only wishes to obtain a stored response
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.1.7" /> .
public
bool
Public
Gets or sets a value that determines if the <c>public</c> response directive is included.
<para>
Indicates that the response may be stored by any cache.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.2.5" /> .
public
bool
Private
Gets or sets a value that determines if the <c>private</c> response directive is included.
<para>
Indicates that the response may not be stored by a shared cache.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.2.6" /> .
public
System.​Collections.​Generic.​ICollection<​Extensions.​Primitives.​StringSegment>
PrivateHeaders
Gets a collection of field names in the "private" directive in a cache-control header field on an HTTP response.
public
bool
MustRevalidate
Gets or sets a value that determines if the <c>must-revalidate</c> response directive is included.
<para>
Indicates that caches must revalidate the use of stale caches with the origin server before their use.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.2.1" /> .
public
bool
ProxyRevalidate
Gets or sets a value that determines if the <c>proxy-validate</c> response directive is included.
<para>
Indicates that shared caches must revalidate the use of stale caches with the origin server before their use.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc7234#section-5.2.2.1" /> .
public
System.​Collections.​Generic.​IList<​NameValueHeaderValue>
Extensions
Gets cache-extension tokens, each with an optional assigned value.
Methods
public
string
ToString​()
public
bool
Equals​(object obj)
public
int
GetHashCode​()
public static
CacheControlHeaderValue
Parse​(Extensions.​Primitives.​StringSegment input)
Parses <paramref name="input" /> as a <see cref="T:Microsoft.Net.Http.Headers.CacheControlHeaderValue" /> value.
Returns The parsed values.
input
The values to parse.
public static
bool
TryParse​(Extensions.​Primitives.​StringSegment input,
CacheControlHeaderValue& parsedValue)
protected
void
Finalize​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object