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
keystringThe identifier for the cache item to retrieve.
Returns
- object
GetEnumerator()
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
keystringThe cache key used to reference the object.
valueobjectThe object to be inserted in the cache.
dependenciesCMSCacheDependencyThe file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache.
absoluteExpirationDateTimeOffsetThe time at which the inserted object expires and is removed from the cache.
slidingExpirationTimeSpanThe interval between the time the inserted object was last accessed and the time at which that object expires.
priorityCMSCacheItemPriorityThe cost of the object relative to other items stored in the cache.
onRemoveCallbackCMSCacheItemRemovedCallbackA 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
keystringThe identifier for the cache item to remove.
Returns
- object