<PackageReference Include="Polly" Version="8.9.0" />

Polly.Caching.ContextualTtl

public class ContextualTtl : ITtlStrategy, ITtlStrategy<object>
Defines a ttl strategy which will cache items for a TimeSpan which may be influenced by data in the execution context.
namespace Polly.Caching { public class ContextualTtl : ITtlStrategy, ITtlStrategy<object> { public static readonly string TimeSpanKey; public static readonly string SlidingExpirationKey; public Ttl GetTtl(Context context, object result); public ContextualTtl(); } }