Interface IObjectInstanceCache

An interface for local, fast caching of object instances.

Namespace: EPiServer.Framework.Cache
Assembly: EPiServer.Framework.dll
Version: 11.20.7
Syntax
public interface IObjectInstanceCache
Remarks

One assumption is that the objects don't need to be serializable - they will be live object instances.

Another assumption is that the items in the cache may be purged at any point-in-time. When you set expiration time the system will only guarantee that the cached item will not be available after the expiration time, but it may be removed before that time depending on the underlying cache implementation.

Methods

Clear()

Removes all entries from the cache.

Declaration
[Obsolete("Method is no longer supported. HttpRuntimeCache can be clearad by iterating over all keys and remove each item")]
void Clear()

Get(String)

Gets the specified object.

Declaration
object Get(string key)
Parameters
Type Name Description
System.String key

The key.

Returns
Type Description
System.Object

The object associated with the key, if it exists. Otherwise returns null.

Insert(String, Object, CacheEvictionPolicy)

Inserts the value into the cache with the specified key.

Declaration
void Insert(string key, object value, CacheEvictionPolicy evictionPolicy)
Parameters
Type Name Description
System.String key

The key.

System.Object value

The value to cache.

CacheEvictionPolicy evictionPolicy

The cache eviction policy.

Remarks

The evicitionPolicy can be null. In that case the item may stay in the cache for an undetermined time.

Remove(String)

Removes the specified object.

Declaration
void Remove(string key)
Parameters
Type Name Description
System.String key

The key.

Extension Methods