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
파일 보기 프로젝트 열기: vanthoainguyen/Flatwhite

공개 메소드들

메소드 설명
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