Polly.Caching.ResultTtl<TResult> public class ResultTtl<TResult> : ITtlStrategy<TResult> Defines a ttl strategy which can calculate a duration to cache items dynamically based on the execution context and result of the execution. Documentation Code namespace Polly.Caching { public class ResultTtl<[Nullable(2)] TResult> : ITtlStrategy<TResult> { public ResultTtl(Func<TResult, Ttl> ttlFunc); public ResultTtl(Func<Context, TResult, Ttl> ttlFunc); public Ttl GetTtl(Context context, TResult result); } }