Used as the slidingExpiration parameter in an Insert method call to disable sliding expirations. This field is read-only.

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


public static readonly TimeSpan NoSlidingExpiration
Visual Basic
Public Shared ReadOnly NoSlidingExpiration As TimeSpan
Visual C++
static initonly TimeSpan NoSlidingExpiration

Field Value

Type: TimeSpan


When used, this field sets the slidingExpiration parameter equal to the Zero field, which has a constant value of zero. The cached item then expires in accordance with the absoluteExpiration parameter.


The following example demonstrates how to use the Insert method to add an item to the Cache object using the NoSlidingExpiration field.
 Copy imageCopy
Cache cache = NCache.InitializeCache("myCache");
cache.Insert("DSN", connectionString, null, DateTime.Now.AddMinutes(2), Cache.NoSlidingExpiration);

See Also