Skip to content

IInvalidatesCache interface

Namespace: Vitreous.Caching.Abstractions
Assembly: Vitreous.Caching.dll

Marks a command (or query) as one that invalidates cache entries after it succeeds. Implement this on any ICommand<TResult> or ICommand to have cache entries removed automatically by CacheInvalidationBehavior.

public interface IInvalidatesCache

Cache entries are only invalidated when the handler returns a successful Result<T>. If the handler fails, no cache keys are touched.

Exact cache keys to remove from the store. Works with all backends (IDistributedCache and Redis).

IReadOnlyList<string> CacheKeys { get; }

IReadOnlyList<string>

Tags whose associated cache entries will be bulk-removed. Only honoured by the Redis backend (Vitreous.Caching.Redis). The base IDistributedCache backend silently ignores this.

IReadOnlyList<string> InvalidatesTags { get; }

IReadOnlyList<string>