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

Ttl

public struct Ttl
Represents a time-to-live for a given cache item.
public bool SlidingExpiration

Whether this Ttl should be considered as sliding expiration: that is, the cache item should be considered valid for a further period of duration Timespan each time the cache item is retrieved.

The timespan for which this cache-item remains valid.

public Ttl(TimeSpan timeSpan)

Creates a new Ttl struct.

public Ttl(TimeSpan timeSpan, bool slidingExpiration)

Creates a new Ttl struct.