RCommon.MemoryCache
2.3.2-alpha.0.2
See the version list below for details.
dotnet add package RCommon.MemoryCache --version 2.3.2-alpha.0.2
NuGet\Install-Package RCommon.MemoryCache -Version 2.3.2-alpha.0.2
<PackageReference Include="RCommon.MemoryCache" Version="2.3.2-alpha.0.2" />
<PackageVersion Include="RCommon.MemoryCache" Version="2.3.2-alpha.0.2" />
<PackageReference Include="RCommon.MemoryCache" />
paket add RCommon.MemoryCache --version 2.3.2-alpha.0.2
#r "nuget: RCommon.MemoryCache, 2.3.2-alpha.0.2"
#:package RCommon.MemoryCache@2.3.2-alpha.0.2
#addin nuget:?package=RCommon.MemoryCache&version=2.3.2-alpha.0.2&prerelease
#tool nuget:?package=RCommon.MemoryCache&version=2.3.2-alpha.0.2&prerelease
RCommon.MemoryCache
Provides two in-process memory caching implementations of ICacheService: one backed by IMemoryCache and another backed by IDistributedCache (in-memory distributed cache), with fluent builder extensions for DI configuration.
Features
InMemoryCacheService-- delegates to Microsoft'sIMemoryCachefor fast in-process caching withGetOrCreate/GetOrCreateAsyncDistributedMemoryCacheService-- delegates toIDistributedCache(in-memory distributed store) with automatic JSON serialization viaIJsonSerializerInMemoryCachingBuilderandDistributedMemoryCacheBuilderfor plugging into theAddRCommon()builder pipelineConfigure()extension to customizeMemoryCacheOptionsorMemoryDistributedCacheOptionsCacheDynamicallyCompiledExpressions()extension to enable expression caching, which improves performance in areas of RCommon that compile expressions and lambdas at runtime
Installation
dotnet add package RCommon.MemoryCache
Usage
using RCommon;
using RCommon.MemoryCache;
services.AddRCommon(builder =>
{
// Option 1: In-process IMemoryCache
builder.WithMemoryCaching<InMemoryCachingBuilder>(cache =>
{
cache.Configure(options => options.SizeLimit = 1024);
cache.CacheDynamicallyCompiledExpressions();
});
// Option 2: Distributed memory cache (IDistributedCache backed by memory)
builder.WithDistributedCaching<DistributedMemoryCacheBuilder>(cache =>
{
cache.Configure(options => options.SizeLimit = 2048);
cache.CacheDynamicallyCompiledExpressions();
});
});
Key Types
| Type | Description |
|---|---|
InMemoryCacheService |
ICacheService implementation backed by IMemoryCache |
DistributedMemoryCacheService |
ICacheService implementation backed by IDistributedCache with JSON serialization |
InMemoryCachingBuilder |
Concrete builder for configuring in-process memory caching |
DistributedMemoryCacheBuilder |
Concrete builder for configuring distributed memory caching |
IInMemoryCachingBuilder |
Builder interface extending IMemoryCachingBuilder |
IDistributedMemoryCachingBuilder |
Builder interface extending IDistributedCachingBuilder |
Documentation
For full documentation, visit rcommon.com.
Related Packages
- RCommon.Caching - Core caching abstractions (
ICacheService,CacheKey, builder contracts) - RCommon.RedisCache - Redis-backed distributed cache implementation
- RCommon.Persistence.Caching.MemoryCache - Wires memory caching into the persistence caching repository decorators
License
Licensed under the Apache License, Version 2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Caching.Memory (>= 10.0.0)
- RCommon.Caching (>= 2.3.2-alpha.0.2)
- RCommon.Json (>= 2.3.2-alpha.0.2)
-
net8.0
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- RCommon.Caching (>= 2.3.2-alpha.0.2)
- RCommon.Json (>= 2.3.2-alpha.0.2)
-
net9.0
- Microsoft.Extensions.Caching.Memory (>= 9.0.10)
- RCommon.Caching (>= 2.3.2-alpha.0.2)
- RCommon.Json (>= 2.3.2-alpha.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on RCommon.MemoryCache:
| Package | Downloads |
|---|---|
|
RCommon.Persistence.Caching.MemoryCache
A cohesive set of infrastructure libraries for dotnet that utilizes abstractions for event handling, persistence, unit of work, mediator, distributed messaging, event bus, CQRS, email, and more |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.4.1 | 17 | 2/18/2026 |
| 2.3.2-alpha.0.3 | 22 | 2/18/2026 |
| 2.3.2-alpha.0.2 | 23 | 2/18/2026 |
| 2.3.2-alpha.0.1 | 46 | 2/9/2026 |
| 2.3.1 | 107 | 2/5/2026 |
| 2.3.0 | 96 | 2/3/2026 |
| 2.2.2-alpha.0.1 | 383 | 12/11/2025 |
| 2.2.1-alpha.0.2 | 122 | 10/24/2025 |
| 2.2.1-alpha.0.1 | 127 | 10/24/2025 |
| 2.1.11-alpha.0.2 | 127 | 10/24/2025 |
| 2.1.11-alpha.0.1 | 91 | 7/18/2025 |
| 2.1.10 | 283 | 7/17/2025 |
| 2.1.9-alpha.0.1 | 142 | 7/17/2025 |
| 2.1.2.4 | 206 | 5/21/2025 |
| 2.1.2.3 | 206 | 5/1/2025 |
| 2.1.2.2 | 454 | 1/23/2025 |
| 2.1.2.1 | 177 | 1/17/2025 |
| 2.1.2 | 152 | 1/17/2025 |
| 2.1.1.4 | 177 | 1/7/2025 |
| 0.0.0-alpha.0 | 144 | 7/17/2025 |