Class CacheDefinition
The caching scope (WSO2 Cache mediator analog): on a hit the body (and optionally the headers)
comes from the cache and the inner steps are skipped; on a miss they run and the result is stored.
Header cache.hit says which. Close with .
public sealed class CacheDefinition : RouteDefinitionBase<CacheDefinition>, IRouteDefinition, IProcessorDefinition, IRouteScope
Inheritance
Implements
Inherited Members
Methods
CacheHeaders(bool)
Store and restore the headers together with the body.
public CacheDefinition CacheHeaders(bool value = true)
CreateProcessor(IRouteContext)
Compile this node into a runtime processor.
public override IProcessor CreateProcessor(IRouteContext context)
Distributed()
Use the IDistributedCache registered in DI or on the context.
public CacheDefinition Distributed()
KeyFromBody()
Key = SHA-256 of the body instead of the explicit key (WSO2 "hash of the request" mode). Only the
public CacheDefinition KeyFromBody()
Region(string)
Key namespace; clear on the component empties one region. Default default.
public CacheDefinition Region(string region)
SlidingExpiration(TimeSpan)
Lifetime renewed on every hit.
public CacheDefinition SlidingExpiration(TimeSpan sliding)