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

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)

Initializes a new instance of the Ttl struct.

public Ttl(TimeSpan timeSpan, bool slidingExpiration)

Initializes a new instance of the Ttl struct.