Field DefaultSlidingLonger
A read only field, used to set expiration for cache entry while adding data to cache. Item will be expired from the cache within DefaultSlidingLonger value + cache clean up interval, if there is no fetching of that particular item. The value for this field is given from NCache Manager. Minimum value for DefaultSlidingLonger expiration is 5s.
Namespace: Alachisoft.NCache.Web.Caching
Assembly: Alachisoft.NCache.Web.dll
Syntax
public static readonly TimeSpan DefaultSlidingLonger
Returns
Type | Description |
---|---|
System.TimeSpan |
Examples
The following example demonstrates how to use DefaultSlidingLonger to add an item to the cache.
Product product = new Product();
product.ProductID = 1001;
product.ProductName = "Tea";
string key = "Product:" + product.ProductID;
cache.Add(key, product, null, Cache.NoAbsoluteExpiration, Cache.DefaultSlidingLonger, CacheItemPriority.Default);