roadie/Roadie.Api.Library/Caching/CachePolicy.cs
2018-12-26 13:39:13 -06:00

23 lines
No EOL
707 B
C#

using System;
namespace Roadie.Library.Caching
{
public sealed class CachePolicy
{
private readonly TimeSpan expiresAfter;
private readonly bool renewLeaseOnAccess;
public TimeSpan ExpiresAfter { get { return this.expiresAfter; } }
/// <summary>
/// If specified, each read of the item from the cache will reset the expiration time
/// </summary>
public bool RenewLeaseOnAccess { get { return this.renewLeaseOnAccess; } }
public CachePolicy(TimeSpan expiresAfter, bool renewLeaseOnAccess = false)
{
this.expiresAfter = expiresAfter;
this.renewLeaseOnAccess = renewLeaseOnAccess;
}
}
}