Defines the expiration details of a cache entry.
public class CacheItemPolicy
The CacheItemPolicy instance contains the expiration details of a cache entry. When the cache object retrieves a cache entry, the policy is checked and if the expiration details is met, the entry is deleted from the cache.
The default constructor of CacheItemPolicy creates a policy that does not expire (maximum value).
CacheItemPolicy supports two types of expiration:
Absolute: The entry will expire at a specific time. To use this set AbsoluteExpiration to the desired date and time and leave SlidingExpiration to the default value of NoSlidingExpiration.
Sliding: The entry will expire if it has not been accessed after for a specific time. To use this set SlidingExpiration to the desired time span value and leave AbsoluteExpiration to the default value of InfiniteAbsoluteExpiration.