Class ContextualTtl
Defines a ttl strategy which will cache items for a TimeSpan which may be influenced by data in the execution context.
public class ContextualTtl : ITtlStrategy
- Inheritance
-
ContextualTtl
- Implements
- Inherited Members
Constructors
ContextualTtl()
public ContextualTtl()
Fields
SlidingExpirationKey
The key on the execution Context to use for storing whether the Ttl should be treated as sliding expiration.
public static readonly string SlidingExpirationKey
Field Value
TimeSpanKey
The key on the execution Context to use for storing the Ttl TimeSpan for which to cache.
public static readonly string TimeSpanKey
Field Value
Methods
GetTtl(Context)
Gets the TimeSpan for which to keep an item about to be cached, which may be influenced by data in the execution context.
public Ttl GetTtl(Context context)
Parameters
context
ContextThe execution context.
Returns
- Ttl
TimeSpan.