Configuration for RedisCachingBackend.
Implements
Namespace: PostSharp.Patterns.Caching.Backends.Redis
Assembly: PostSharp.Patterns.Caching.Backends.Redis.dll
Syntax
public class RedisCachingBackendConfiguration : ICloneableRemarks
The configuration becomes read-only when it is passed to Create(IConnectionMultiplexer, RedisCachingBackendConfiguration) or CreateAsync(IConnectionMultiplexer, RedisCachingBackendConfiguration, CancellationToken). Use Clone() to get a modifiable copy.
Constructors
| Name | Description |
|---|---|
| RedisCachingBackendConfiguration() |
Properties
| Name | Description |
|---|---|
| BackgroundRecoveryRetryPolicy | Gets or sets the IRetryPolicy that handles the retry loop of background recovery actions (see InvalidateDependencyInBackground or RemoveItemInBackground). The default value is the default instance of the BackgroundTasksRetryPolicy class. |
| BackgroundTasksMaxConcurrency | Gets or sets the maximum number of concurrent background tasks. This number must be kept low to avoid overloading the system or the cache with bursts, for example when Redis processes evictions. The default value is 25. |
| BackgroundTasksOverloadedThreshold | Gets or sets the number of tasks over which the RedisCachingBackend notifies its state as overloaded through the IsBackgroundTaskQueueOverloaded property and the IsBackgroundTaskQueueOverloadedChanged event. The default value is 125. The RedisCacheDependencyGarbageCollector component stops processing real-time eviction and expiration notifications when the component is overloaded. |
| BackgroundTasksRetryPolicy | Gets or sets the IRetryPolicy that handles the retries of background (non-blocking) operations. The default value is the default instance of the BackgroundTasksRetryPolicy class. |
| ConnectionTimeout | Gets or sets the time that the Redis backend waits for a Redis connection. When you create a new Redis backend, a TimeoutException is thrown if it does not connect to a Redis server within this time. |
| CreateSerializer | Gets or sets a function that creates the serializer used to serialize objects into byte arrays (and conversely).
The default value is |
| Database | Gets or sets the index of the database to use. The default value is |
| DefaultExpiration | Gets or sets the default expiration time of cached items. All items that do not have an explicit expiration time are automatically expired according to the value of this property, unless they have the NotRemovable priority. The default value is 30 days. |
| DisposeTimeout | Gets or sets the timeout of the Dispose methods if no cancellation token is provided. The default value is 30 seconds. Note that there are still some situations where the Dispose operation cannot be canceled or timed out. |
| ExceptionHandlingPolicy | Gets or sets the IExceptionHandlingPolicy, which determines how exceptions in the RedisCachingBackend component are handled. The default value is an instance of the DefaultExceptionHandlingPolicy class. |
| InvalidationMaxConcurrency | Gets or sets the maximum number of items that can be invalidated concurrently by a single call of the InvalidateDependency(string), RemoveItem(string), or SetItem(string, CacheItem) method (or their asynchronous equivalents). The aim of this setting is to prevent the invalidation of large graphs from overloading the system. Instead, only the expensive invalidation operations will be throttled. |
| IsFrozen | Gets a value indicating whether the current instance is frozen, that is, read-only. |
| IsLocallyCached | Gets or sets a value indicating whether a MemoryCachingBackend should be added in front of the RedisCachingBackend. |
| KeyCompressingThreshold | Gets or sets the length threshold over which cache keys are hashed. The default value is 127. |
| KeyPrefix | Gets or sets the prefix for the keys of all Redis items created by the RedisCachingBackend. The default value is |
| OwnsConnection | Gets or sets a value indicating whether the RedisCachingBackend should dispose the Redis connection when the RedisCachingBackend itself is disposed. |
| ReadCommandFlags | Gets or sets the StackExchange.Redis.CommandFlags for read Redis operations. |
| SupportsDependencies | Gets or sets a value indicating whether the RedisCachingBackend should support dependencies. When this property is used, the PostSharp.Patterns.Caching.Backends.Redis.DependenciesRedisCachingBackend class is used instead of RedisCachingBackend. When dependencies are enabled, at least one instance of the RedisCacheDependencyGarbageCollector must run. |
| SupportsEvents | Gets or sets a value indicating whether the RedisCachingBackend supports raising events. It is disabled by default. |
| TransactionMaxRetries | Gets or sets the number of times Redis transactions are retried when they fail due to a data conflict, before an exception
is raised. The default value is |
| TransactionRetryPolicy | Gets or sets the IRetryPolicy that handles the retry loop of Redis transactions. The default value is the default instance of the TransactionRetryPolicy class. |
| WriteCommandFlags | Gets or sets the StackExchange.Redis.CommandFlags for write Redis operations. |
Methods
| Name | Description |
|---|---|
| CheckFrozen() | Throws an InvalidOperationException if the object has been frozen. |
| Clone() | Returns a non-frozen clone of the current instance. |