Class CacheableOptions
- Namespace
- Cuemon.AspNetCore.Http.Headers
- Assembly
- Cuemon.AspNetCore.dll
Configuration options for CacheableMiddleware.
public class CacheableOptions : IValidatableParameterObject, IParameterObject
- Inheritance
-
CacheableOptions
- Implements
Constructors
CacheableOptions()
Initializes a new instance of the CacheableOptions class.
public CacheableOptions()
Remarks
The following table shows the initial property values for an instance of CacheableOptions.
Property | Initial Value |
---|---|
CacheControl |
|
Expires | new ExpiresHeaderValue(TimeSpan.FromDays(7)); |
Properties
CacheControl
Gets or sets the Cache-Control header associated with a HTTP response.
public CacheControlHeaderValue CacheControl { get; set; }
Property Value
- CacheControlHeaderValue
The Cache-Control header associated with a HTTP response.
Expires
Gets or sets the Expires header associated with a HTTP response.
public ExpiresHeaderValue Expires { get; set; }
Property Value
- ExpiresHeaderValue
The Expires header associated with a HTTP response.
UseCacheControl
Gets a value indicating whether this instance has an assigned CacheControl value.
public bool UseCacheControl { get; }
Property Value
- Boolean
true
if this instance has a CacheControl assigned; otherwise,false
.
UseExpires
Gets a value indicating whether this instance has an assigned Expires value.
public bool UseExpires { get; }
Property Value
Validators
Gets the validators that will be invoked one by one in InvokeAsync(HttpContext).
public IList<ICacheableValidator> Validators { get; set; }
Property Value
- IList<ICacheableValidator>
The validators that will be invoked by CacheableMiddleware.
Methods
ValidateOptions()
Determines whether the public read-write properties of this instance are in a valid state.
public void ValidateOptions()
Remarks
This method is expected to throw exceptions when one or more conditions fails to be in a valid state.
Exceptions
- InvalidOperationException
Validators cannot be null.