The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.

Namespace: Alachisoft.NCache.Web.Caching
Assembly: Alachisoft.NCache.Web (in Alachisoft.NCache.Web.dll) Version: 4.1.0.0 (4.1.0.0)

Syntax

C#
public TimeSpan SlidingExpiration { get; set; }
Visual Basic
Public Property SlidingExpiration As TimeSpan
	Get
	Set
Visual C++
public:
property TimeSpan SlidingExpiration {
	TimeSpan get ();
	void set (TimeSpan value);
}

Field Value

The default value is Cache.NoSlidingExpiration.

Remarks

If the slidingExpiration property is set to NoSlidingExpiration, sliding expiration is disabled. If you set the slidingExpiration parameter to less than Zero, or the equivalent of more than one year, an ArgumentOutOfRangeException is thrown when you will try to add or insert the CacheItem. You cannot set both sliding and absolute expirations on the same cached item. If you do so, an ArgumentException is thrown when you will try to add or insert the CacheItem.

See Also