November Happy Hour will be moved to Thursday December 5th.

Class ReplicatedCache<TValue>

Provides a cache than can be replicated in a load balanced environment

Inheritance
System.Object
LocalCache<System.String, TValue>
ReplicatedCache<TValue>
Implements
System.IDisposable
Namespace: EPiServer.Data.Cache
Assembly: EPiServer.Data.dll
Version: 9.12.2
Syntax
public class ReplicatedCache<TValue> : LocalCache<string, TValue>, IDisposable
Type Parameters
Name Description
TValue

Constructors

ReplicatedCache(String)

Declaration
public ReplicatedCache(string remoteKey)
Parameters
Type Name Description
System.String remoteKey

Methods

Add(String, Boolean, Boolean, Func<TValue>, Boolean)

Creates a new element or overwrites any existing value for the specified key

Declaration
public virtual TValue Add(string key, bool cacheNullValues, bool overwriteExistingValue, Func<TValue> action, bool broadcast)
Parameters
Type Name Description
System.String key

The key of the value to set

System.Boolean cacheNullValues

Specifies if null values returned from the delegate should be stored in the cache

System.Boolean overwriteExistingValue
true
if an existing value in the cache should be updated with the new value, otherwise
false
System.Func<TValue> action

A delegate to generate the value to set in the cache

System.Boolean broadcast

True if the action performed should cause the cache event should be broadcasted

Returns
Type Description
TValue

The value generated by the delegate

Exceptions
Type Condition
System.ArgumentNullException

Key is null

Clear()

Declaration
public override void Clear()
Overrides
EPiServer.Data.Cache.LocalCache<System.String, TValue>.Clear()

InternalSet(String, TValue)

Declaration
protected override void InternalSet(string key, TValue value)
Parameters
Type Name Description
System.String key
TValue value
Overrides
EPiServer.Data.Cache.LocalCache<System.String, TValue>.InternalSet(System.String, TValue)

Remove(String)

Declaration
public override void Remove(string key)
Parameters
Type Name Description
System.String key
Overrides
EPiServer.Data.Cache.LocalCache<System.String, TValue>.Remove(System.String)

Implements

System.IDisposable

Extension Methods