Skip to content

ISwrStore interface

Abstraction for the SWR cache storage backend. Implement this to use a custom store (e.g., Redis via IDistributedCache). The default implementation is an in-memory ConcurrentDictionary-based store.

public interface ISwrStore
namedescription
Clear()Removes all cache entries from the store.
Evict(…)Removes a single cache entry by exact key.
InvalidateByPrefix(…)Removes all cache entries whose keys start with the given prefix.
Set(…)Stores or overwrites a cache entry with the current timestamp.
TryGet(…)Attempts to retrieve a cache entry by key. Returns true if found.