A cache shared amongst all application nodes.
IDistributedCacheProvider
is defined in the Telligent.Evolution.Extensibility.Caching.Version1
namespace of Telligent.Evolution.Platform.dll
Definition
interface IDistributedCacheProvider : IPlugin, ISingletonPlugin { void Accessed(string[] keys); void Clear(); Byte[] Get(string key); void Put(string key, Byte[] value, string[] tags, TimeSpan? absoluteTimeout); void Remove(string key); void RemoveByTags(string[] tags); }
Methods
void Accessed(string[] keys);
Notification that data at the provided keys was accessed from a local cache and the distributed cache implementation can update its statistics. This is not called on each access, but is called periodically based on activity.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
keys | string[] | Keys | Required |
void Clear();
Remove all values.
Byte[] Get(string key);
Retrieves the value associated with the provided key, or null if the data does not exist in the cache.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
key | string | Key | Required |
Return Type
Byte[]
void Put(string key, Byte[] value, string[] tags, TimeSpan? absoluteTimeout);
Adds or updates the value associated with the provided key. Tags are shared identifiers associated to this cached value (tags can be null or empty). If absoluteTimeout has a value, the value is expected to expire from the cache after the provided duration (TimeSpan.Zero represents an infinite duration). If absoluteTimeout does not have a value, the cache is free to implement a default or a sliding expiration.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
key | string | Key | Required | ||
value | Byte[] | Value | Required | ||
tags | string[] | Tags | Required | ||
absoluteTimeout | TimeSpan? | Absolute Timeout | Required |
void Remove(string key);
Removes the value associated with the key.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
key | string | Key | Required |
void RemoveByTags(string[] tags);
Removes values associated with at least one of the provided tags (shared identifiers).
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
tags | string[] | Tags | Required |