Doesn't this mean that the item expires any time that the expiration date is in the future?
So how would you possibly set something to expire (for example) in 10 minutes?
private bool IsExpired(CacheItem item, CacheItemOptions options, DateTimeOffset current)
{
if (options.AbsoluteExpiration.HasValue)
{
if (options.AbsoluteExpiration >= current)
{
return true;
}
}
if (options.SlidingExpiration.HasValue)
{
if ((current - item.LastAccess) >= options.SlidingExpiration.Value)
{
return true;
}
}
return false;
}