$ show thepirat000/CachingFramework.Redis
The CachingFramework.Redis library is a .NET caching abstraction built on top of StackExchange.Redis. It provides a rich set of features including cache-aside patterns, tag-based invalidation, support for Redis data structures (strings, hashes, sets, sorted sets, bitmaps, HyperLogLog, geospatial), pub/sub, and key space notifications. The architecture centers around RedisContext as the main entry point, which provides access to modular features like Cache, Collections, GeoSpatial, PubSub, and KeyEvents. The library employs a provider pattern for encapsulating Redis operations and offers extensible serialization via an ISerializer interface with multiple implementations (binary, JSON, MessagePack, MemoryPack). It is designed for dependency injection and follows .NET best practices with async/await support and proper configuration management.
The LLM identified 2 files worth highlighting for reuse:
Defines the ISerializer interface for pluggable serialization strategies. Core library depends only on this abstraction, allowing different serializers (JSON, MessagePack, etc.) to be implemented in separate projects without modifying core logic. Demonstrates clean separation of concerns and dependency inversion principle.
Contains two extension methods for Task (SuppressFlow and PreserveFlow) that manage ExecutionContext flow to avoid unnecessary context capture in asynchronous library code. Self-contained, zero-dependency utility that can be copied to any .NET project to improve async performance and prevent thread starvation.