C# Class 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.
Inheritance: System.Net.Http.DelegatingHandler
Exibir arquivo Open project: vanthoainguyen/Flatwhite

Public Methods

Method Description
CacheMessageHandler ( ICachControlHeaderHandlerProvider handlerProvider ) : System

Initializes an instance of CacheMessageHandler from a provided ICachControlHeaderHandlerProvider

Protected Methods

Method Description
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

Method Details

CacheMessageHandler() public method

Initializes an instance of CacheMessageHandler from a provided ICachControlHeaderHandlerProvider
public CacheMessageHandler ( ICachControlHeaderHandlerProvider handlerProvider ) : System
handlerProvider ICachControlHeaderHandlerProvider
return System

SendAsync() protected method

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
return Task