C# Класс Flatwhite.WebApi.OutputCacheAttribute

Наследование: System.Web.Http.Filters.ActionFilterAttribute, ICacheSettings
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetAllVaryCustomKey ( ) : string

Get all vary by custom string

OnActionExecutedAsync ( System.Web.Http.Filters.HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken ) : Task

Store the response to cache store, add CacheControl and Etag to response

OnActionExecutingAsync ( System.Web.Http.Controllers.HttpActionContext actionContext, CancellationToken cancellationToken ) : Task

Check CacheControl request, get CacheItem, build response and return if cache available

Защищенные методы

Метод Описание
ApplyCacheHeaders ( HttpResponseMessage response, HttpRequestMessage request ) : void

Apply the CacheControl header to response

GetCacheResponseBuilder ( IDependencyScope scope ) : ICacheResponseBuilder

Get ICacheResponseBuilder from IDependencyScope

GetCacheStrategy ( IDependencyScope scope, _IInvocation invocation, object>.IDictionary invocationContext ) : ICacheStrategy

Get ICacheStrategy from IDependencyScope

GetInvocation ( System.Web.Http.Controllers.HttpActionContext actionContext ) : _IInvocation

Get _IInvocation from HttpActionContext

GetInvocationContext ( System.Web.Http.Controllers.HttpActionContext actionContext ) : object>.IDictionary

Get context data from HttpActionContext

HashCacheKey ( string originalCacheKey ) : string

Make a hash string of the original senstivive cacheKey

ShouldIgnoreCache ( CacheControlHeaderValue cacheControl, HttpRequestMessage request ) : bool

Determine whether or not should ignore all the cache settings base on the

Приватные методы

Метод Описание
CreatePhoenix ( _IInvocation invocation, WebApiCacheItem cacheItem, HttpRequestMessage request ) : void

Create the phoenix object which can refresh the cache itself if StaleWhileRevalidate > 0

GetHashString ( byte content ) : string
RefreshCache ( string storedKey ) : void

Описание методов

ApplyCacheHeaders() защищенный Метод

Apply the CacheControl header to response
protected ApplyCacheHeaders ( HttpResponseMessage response, HttpRequestMessage request ) : void
response System.Net.Http.HttpResponseMessage
request System.Net.Http.HttpRequestMessage
Результат void

GetAllVaryCustomKey() публичный Метод

Get all vary by custom string
public GetAllVaryCustomKey ( ) : string
Результат string

GetCacheResponseBuilder() защищенный Метод

Get ICacheResponseBuilder from IDependencyScope
protected GetCacheResponseBuilder ( IDependencyScope scope ) : ICacheResponseBuilder
scope IDependencyScope
Результат ICacheResponseBuilder

GetCacheStrategy() защищенный Метод

Get ICacheStrategy from IDependencyScope
protected GetCacheStrategy ( IDependencyScope scope, _IInvocation invocation, object>.IDictionary invocationContext ) : ICacheStrategy
scope IDependencyScope
invocation _IInvocation
invocationContext object>.IDictionary
Результат ICacheStrategy

GetInvocation() защищенный Метод

Get _IInvocation from HttpActionContext
protected GetInvocation ( System.Web.Http.Controllers.HttpActionContext actionContext ) : _IInvocation
actionContext System.Web.Http.Controllers.HttpActionContext
Результат _IInvocation

GetInvocationContext() защищенный Метод

Get context data from HttpActionContext
protected GetInvocationContext ( System.Web.Http.Controllers.HttpActionContext actionContext ) : object>.IDictionary
actionContext System.Web.Http.Controllers.HttpActionContext
Результат object>.IDictionary

HashCacheKey() защищенный Метод

Make a hash string of the original senstivive cacheKey
protected HashCacheKey ( string originalCacheKey ) : string
originalCacheKey string
Результат string

OnActionExecutedAsync() публичный Метод

Store the response to cache store, add CacheControl and Etag to response
public OnActionExecutedAsync ( System.Web.Http.Filters.HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken ) : Task
actionExecutedContext System.Web.Http.Filters.HttpActionExecutedContext
cancellationToken System.Threading.CancellationToken
Результат Task

OnActionExecutingAsync() публичный Метод

Check CacheControl request, get CacheItem, build response and return if cache available
public OnActionExecutingAsync ( System.Web.Http.Controllers.HttpActionContext actionContext, CancellationToken cancellationToken ) : Task
actionContext System.Web.Http.Controllers.HttpActionContext
cancellationToken System.Threading.CancellationToken
Результат Task

ShouldIgnoreCache() защищенный Метод

Determine whether or not should ignore all the cache settings base on the
protected ShouldIgnoreCache ( CacheControlHeaderValue cacheControl, HttpRequestMessage request ) : bool
cacheControl System.Net.Http.Headers.CacheControlHeaderValue
request System.Net.Http.HttpRequestMessage
Результат bool