How does this expiration make sense?

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;
        }

Absolutely would expire the item in 10 minutes, sliding would expire it if it ain't accessed for 10 minutes

But it wouldn't...If i set the expiration to 10 minutes in the future, it will pass this if:

if (options.AbsoluteExpiration >= current)​
And return `true` (ie 10 minutes in the future is already expired because it's greater than current time)

It's all dependent on what's running the cleanup. Can't remember if I had it on OnTick or if it's based on access only. But obviously if the cleanup hasn't happened yet and the current time is past the expire time then it wouldn't return as expired so the extra check needs to be put in.