Interface IAppPolicyCache
Defines an application cache that support cache policies.
Namespace: Umbraco.Cms.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, String[])
Gets an item identified by its key.
Declaration
object Get(string key, Func<object> factory, TimeSpan? timeout, bool isSliding = false, string[] dependentFiles = null)
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). |
System.String[] | dependentFiles | Files the cache entry depends on. |
Returns
Type | Description |
---|---|
System.Object | The item. |
Insert(String, Func<Object>, Nullable<TimeSpan>, Boolean, String[])
Inserts an item.
Declaration
void Insert(string key, Func<object> factory, TimeSpan? timeout = null, bool isSliding = false, string[] dependentFiles = null)
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). |
System.String[] | dependentFiles | Files the cache entry depends on. |