Open sandboxFocus

Class RedisCachingBackendConfiguration

Configuration for RedisCachingBackend.

Inheritance
RedisCachingBackendConfiguration
Implements
Namespace: PostSharp.Patterns.Caching.Backends.Redis
Assembly: PostSharp.Patterns.Caching.Backends.Redis.dll
Syntax
public class RedisCachingBackendConfiguration : ICloneable

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 maximal number of concurrent background tasks. This number must be kept low to avoid overloading the system or the cache with bursts, for instance 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 will wait for a Redis connection. (When you create a new Redis backend, if it doesn't connect to a Redis server in this timeout, a TimeoutException is thrown.)

CreateSerializer

Gets or sets a function that creates the serializer used to serialize objects into byte arrays (and conversely). The default value is null, which means that JsonCachingSerializer will be used.

Database

Gets the index of the database to use. The default value is -1 (automatic selection).

DefaultExpiration

Gets or sets the default expiration time of cached items. All items that don't 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 is 30 seconds. Note that are still some situations where the Dispose operation cannot be cancelled 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 async equivalent). The aim of this setting is to prevent the invalidation of large graphs to overload the system. Instead, only the expensive invalidation operations will be throttled.

IsFrozen

Determines whether the current instance is frozen (i.e. read-only).

IsLocallyCached

Determines whether a MemoryCachingBackend should be added in front of the RedisCachingBackend.

KeyCompressingThreshold

Gets or sets the lenght threshold over which cache keys are hashed. The default value in 127.

KeyPrefix

Gets the prefix for the key of all Redis items created by the RedisCachingBackend. The default value is cache.

OwnsConnection

Determines 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

Determines 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

Determines if 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 5.

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 read 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.