Class HttpRuntimeCache

Default implementation of IObjectInstanceCache.

Inheritance
System.Object
HttpRuntimeCache
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Framework.Cache
Assembly: EPiServer.Framework.AspNet.dll
Version: 11.20.7
Syntax
[ServiceConfiguration(typeof(IObjectInstanceCache), Lifecycle = ServiceInstanceScope.Singleton)]
public class HttpRuntimeCache : IObjectInstanceCache, IDisposable
Remarks

Uses HttpRuntime.Cache as the underlying cache mechanism.

Constructors

HttpRuntimeCache()

Initializes a new instance of the HttpRuntimeCache class.

Declaration
public HttpRuntimeCache()

Methods

Clear()

Removes all entries from the cache.

Declaration
public virtual void Clear()

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

Get(String)

Gets the specified object.

Declaration
public virtual 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
public virtual 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
public virtual void Remove(string key)
Parameters
Type Name Description
System.String key

The key.

Implements

System.IDisposable

Extension Methods