Interface IAppPolicyCache
Defines an application cache that support cache policies.
Namespace: Umbraco.Cms.Core.Cache
Assembly: Umbraco.Core.dll
Syntax
public interface IAppPolicyCache : IAppCacheRemarks
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)
Gets an item identified by its key.
Declaration
object Get(string key, Func<object> factory, TimeSpan? timeout, bool isSliding = false)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | key | The key of the item. | 
| Func<System.Object> | factory | A factory function that can create the item. | 
| System.Nullable<TimeSpan> | timeout | An optional cache timeout. | 
| System.Boolean | isSliding | An optional value indicating whether the cache timeout is sliding (default is false). | 
Returns
| Type | Description | 
|---|---|
| System.Object | The item. | 
Insert(String, Func<Object>, Nullable<TimeSpan>, Boolean)
Inserts an item.
Declaration
void Insert(string key, Func<object> factory, TimeSpan? timeout = null, bool isSliding = false)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | key | The key of the item. | 
| Func<System.Object> | factory | A factory function that can create the item. | 
| System.Nullable<TimeSpan> | timeout | An optional cache timeout. | 
| System.Boolean | isSliding | An optional value indicating whether the cache timeout is sliding (default is false). |