TwoLevelCacheExtensions class

namespace: Serenity   assemblySerenity.Net.Core

Contains extension functions to use local and distributed cache in sync with optional cache invalidation.

public static class TwoLevelCacheExtensions

Public Members

name description
static ExpireGroupItems(…) Changes a group generation value, so that all items that depend on it are expired.
static Get<TItem>(…) Tries to read a value from local cache. If it is not found there, tries the distributed cache. If neither contains the specified key, produces value by calling a loader function and adds the value to local and distributed cache for a given expiration time. By using a group key, all items on both cache types that are members of this group can be expired at once. (2 methods)
static GetLocalStoreOnly<TItem>(…) Tries to read a value from local cache. If it is not found there produces value by calling a loader function and adds the value to local cache for a given expiration time. By using a generation (item version) key, all items on local cache that are members of this group can be expired at once.
static Remove(…) Removes a key from local, distributed caches, and removes their generation version information.
static Set<TItem>(…) Creates or overrides a specified entry in the local and distributed cache. (2 methods)
static SetLocalStoreOnly<TItem>(…) Creates or overrides a specified entry in the local cache.

See Also