Table of Contents

Interface ICacheAccessor

Namespace
CMS.Helpers.Caching.Abstractions
Assembly
CMS.Helpers.dll

Represents a cache with reading, inserting and removing support.

public interface ICacheAccessor
Extension Methods

Methods

Get(string)

Retrieves the specified item from the cache.

object Get(string key)

Parameters

key string

The identifier for the cache item to retrieve.

Returns

object

GetEnumerator()

Retrieves a dictionary enumerator used to iterate through the key settings and their values contained in the cache.
IDictionaryEnumerator GetEnumerator()

Returns

IDictionaryEnumerator

Insert(string, object, CMSCacheDependency, DateTimeOffset, TimeSpan, CMSCacheItemPriority, CMSCacheItemRemovedCallback)

Inserts an object into the cache.

void Insert(string key, object value, CMSCacheDependency dependencies, DateTimeOffset absoluteExpiration, TimeSpan slidingExpiration, CMSCacheItemPriority priority, CMSCacheItemRemovedCallback onRemoveCallback)

Parameters

key string

The cache key used to reference the object.

value object

The object to be inserted in the cache.

dependencies CMSCacheDependency

The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache.

absoluteExpiration DateTimeOffset

The time at which the inserted object expires and is removed from the cache.

slidingExpiration TimeSpan

The interval between the time the inserted object was last accessed and the time at which that object expires.

priority CMSCacheItemPriority

The cost of the object relative to other items stored in the cache.

onRemoveCallback CMSCacheItemRemovedCallback

A delegate that, if provided, will be called when an object is removed from the cache.

Remove(string)

Removes the specified item from the cache.

object Remove(string key)

Parameters

key string

The identifier for the cache item to remove.

Returns

object

See Also