Class HttpResponseCacheMiddleware
GET/HEAD response cache middleware. Only allocated when placed in the middleware list; otherwise the hot path pays nothing.
Implements
IProxyMiddleware
Inherited Members
Namespace: Titanium.Web.Proxy.Caching
Assembly: Titanium.Web.Proxy.dll
Syntax
public sealed class HttpResponseCacheMiddleware : IProxyMiddleware
Constructors
| Edit this page View SourceHttpResponseCacheMiddleware(IHttpResponseCache, TimeSpan?)
Declaration
public HttpResponseCacheMiddleware(IHttpResponseCache cache, TimeSpan? defaultTtl = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IHttpResponseCache | cache | |
| TimeSpan? | defaultTtl |
Methods
| Edit this page View SourceInvokeAsync(ProxyMiddlewareContext, ProxyMiddlewareDelegate, CancellationToken)
Declaration
public ValueTask InvokeAsync(ProxyMiddlewareContext context, ProxyMiddlewareDelegate next, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| ProxyMiddlewareContext | context | |
| ProxyMiddlewareDelegate | next | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| ValueTask |
TryCacheCurrentResponse(SessionEventArgs)
Call from the session response path when a small 200 body is already buffered.
Declaration
public void TryCacheCurrentResponse(SessionEventArgs session)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionEventArgs | session |
Implements
Titanium.Web.Proxy.Abstractions.Middleware.IProxyMiddleware