System.Web.Caching.Cache.Insert Method

Inserts an object into the System.Web.Caching.Cache that has file or key dependencies.

Syntax

public void Insert (string key, object value, CacheDependency dependencies)

Parameters

key
The cache key used to identify the item.
value
The object to be inserted in the cache.
dependencies
The file or cache key dependencies for the inserted object. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this parameter contains null.

Remarks

This method will overwrite an existing cache item whose key matches the key parameter. The object added to the cache using this overload of the Insert method is inserted with no file or cache dependencies, a priority of CacheItemPriority.Default, a sliding expiration value of Cache.NoSlidingExpiration, and an absolute expiration value of Cache.NoAbsoluteExpiration.

Requirements

Namespace: System.Web.Caching
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0