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

This is a custom WebApi message handler which try to build the response if cache data is available This should create a response asap if there is the cache without waiting for the OutputCacheAttribute to do that which is quite late and quite heavy "if your controller has too many dependencies". People should try to not having heavy Controller anyway.
Наследование: System.Net.Http.DelegatingHandler
Показать файл Открыть проект

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

Метод Описание
CacheMessageHandler ( ICachControlHeaderHandlerProvider handlerProvider ) : System

Initializes an instance of CacheMessageHandler from a provided ICachControlHeaderHandlerProvider

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

Метод Описание
SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task

Process the request and attempt to build the response from cache If it failed, it simply logs the error and continue the pipeline

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

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

Initializes an instance of CacheMessageHandler from a provided ICachControlHeaderHandlerProvider
public CacheMessageHandler ( ICachControlHeaderHandlerProvider handlerProvider ) : System
handlerProvider ICachControlHeaderHandlerProvider
Результат System

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

Process the request and attempt to build the response from cache If it failed, it simply logs the error and continue the pipeline
protected SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task
request System.Net.Http.HttpRequestMessage
cancellationToken System.Threading.CancellationToken
Результат Task