Interface IAppPolicyCache
Defines an application cache that support cache policies.
Namespace: Umbraco.Core.Cache
Assembly: Umbraco.Core.dll
Syntax
public interface IAppPolicyCache : IAppCache
Remarks
A cache policy can be used to cache with timeouts, or depending on files, and with a remove callback, etc.
Methods
View SourceGet(String, Func<Object>, Nullable<TimeSpan>, Boolean, CacheItemPriority, CacheItemRemovedCallback, String[])
Gets an item identified by its key.
Declaration
object Get(string key, Func<object> factory, TimeSpan? timeout, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, string[] dependentFiles = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the item. |
System.Func<System.Object> | factory | A factory function that can create the item. |
System.Nullable<System.TimeSpan> | timeout | An optional cache timeout. |
System.Boolean | isSliding | An optional value indicating whether the cache timeout is sliding (default is false). |
System.Web.Caching.CacheItemPriority | priority | An optional cache priority (default is Normal). |
System.Web.Caching.CacheItemRemovedCallback | removedCallback | An optional callback to handle removals. |
System.String[] | dependentFiles | Files the cache entry depends on. |
Returns
Type | Description |
---|---|
System.Object | The item. |
Insert(String, Func<Object>, Nullable<TimeSpan>, Boolean, CacheItemPriority, CacheItemRemovedCallback, String[])
Inserts an item.
Declaration
void Insert(string key, Func<object> factory, TimeSpan? timeout = null, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, string[] dependentFiles = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the item. |
System.Func<System.Object> | factory | A factory function that can create the item. |
System.Nullable<System.TimeSpan> | timeout | An optional cache timeout. |
System.Boolean | isSliding | An optional value indicating whether the cache timeout is sliding (default is false). |
System.Web.Caching.CacheItemPriority | priority | An optional cache priority (default is Normal). |
System.Web.Caching.CacheItemRemovedCallback | removedCallback | An optional callback to handle removals. |
System.String[] | dependentFiles | Files the cache entry depends on. |