Table of Contents

Class HttpCacheableOptions

Namespace
Cuemon.AspNetCore.Mvc.Filters.Cacheable
Assembly
Cuemon.AspNetCore.Mvc.dll

Specifies options that is related to the HttpCacheableFilter.

public class HttpCacheableOptions : IValidatableParameterObject, IParameterObject
Inheritance
HttpCacheableOptions
Implements

Constructors

HttpCacheableOptions()

Initializes a new instance of the HttpCacheableOptions class.

public HttpCacheableOptions()

Remarks

The following table shows the initial property values for an instance of HttpCacheableOptions.

PropertyInitial Value
Filtersnew List{ICacheableAsyncResultFilter}()
CacheControlnew CacheControlHeaderValue() { MaxAge = TimeSpan.FromMinutes(5), MustRevalidate = true, Private = true };

Properties

CacheControl

Gets or sets the Cache-Control header that is applied to objects implementing the ICacheableObjectResult interface.

public CacheControlHeaderValue CacheControl { get; set; }

Property Value

CacheControlHeaderValue

The Cache-Control header that is applied to objects implementing the ICacheableObjectResult interface.

Filters

Gets the filters that will be invoked one by one in OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate).

public IList<ICacheableAsyncResultFilter> Filters { get; set; }

Property Value

IList<ICacheableAsyncResultFilter>

The filters that will be invoked by HttpCacheableFilter.

UseCacheControl

Gets a value indicating whether this instance has an CacheControl.

public bool UseCacheControl { get; }

Property Value

Boolean

true if this instance has an CacheControl; otherwise, false.

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

Filters cannot be null.