![]() |
VOOZH | about |
dotnet add package Rystem.RepositoryFramework.Cache.Azure.Storage.Blob --version 10.0.8
NuGet\Install-Package Rystem.RepositoryFramework.Cache.Azure.Storage.Blob -Version 10.0.8
<PackageReference Include="Rystem.RepositoryFramework.Cache.Azure.Storage.Blob" Version="10.0.8" />
<PackageVersion Include="Rystem.RepositoryFramework.Cache.Azure.Storage.Blob" Version="10.0.8" />Directory.Packages.props
<PackageReference Include="Rystem.RepositoryFramework.Cache.Azure.Storage.Blob" />Project file
paket add Rystem.RepositoryFramework.Cache.Azure.Storage.Blob --version 10.0.8
#r "nuget: Rystem.RepositoryFramework.Cache.Azure.Storage.Blob, 10.0.8"
#:package Rystem.RepositoryFramework.Cache.Azure.Storage.Blob@10.0.8
#addin nuget:?package=Rystem.RepositoryFramework.Cache.Azure.Storage.Blob&version=10.0.8Install as a Cake Addin
#tool nuget:?package=Rystem.RepositoryFramework.Cache.Azure.Storage.Blob&version=10.0.8Install as a Cake Tool
Rystem.RepositoryFramework.Cache.Azure.Storage.Blob adds a Blob Storage-backed distributed cache adapter for Repository Framework decorators.
It does not cache entities directly inside your main repository storage. Instead, it registers a dedicated internal repository for BlobStorageCacheModel and uses Azure Blob Storage as the persistence layer for cache entries.
dotnet add package Rystem.RepositoryFramework.Cache.Azure.Storage.Blob
This package builds on top of:
Rystem.RepositoryFramework.CacheRystem.RepositoryFramework.Infrastructure.Azure.Storage.BlobCalling WithBlobStorageCache(...) does two things:
IRepository<BlobStorageCacheModel, string> backed by the Blob Storage infrastructure packageBlobStorageCache<T, TKey> as the distributed cache decorator for your repository, query, or command registrationEach cached value is stored as a blob containing:
Expiration as a DateTimeValue as serialized JSONAt read time the adapter:
Expiration with DateTime.UtcNowIf the entry is expired, the adapter simply returns a cache miss. The current implementation does not automatically delete the stale blob during that read.
builder.Services.AddRepository<User, string>(repositoryBuilder =>
{
repositoryBuilder.WithBlobStorage(storage =>
{
storage.Settings.ConnectionString = builder.Configuration["ConnectionStrings:Storage"];
storage.Settings.ContainerName = "users";
});
repositoryBuilder.WithBlobStorageCache(
cacheStorage =>
{
cacheStorage.Settings.ConnectionString = builder.Configuration["ConnectionStrings:Storage"];
cacheStorage.Settings.ContainerName = "user-cache";
cacheStorage.Settings.Prefix = "cache/";
},
cache =>
{
cache.ExpiringTime = TimeSpan.FromMinutes(5);
cache.Methods = RepositoryMethods.Get
| RepositoryMethods.Query
| RepositoryMethods.Exist;
});
});
This keeps your domain data container separate from your cache container, which is usually the cleanest setup.
The package exposes overloads for all three Repository Framework patterns.
builder.Services.AddRepository<Document, Guid>(repositoryBuilder =>
{
repositoryBuilder.WithBlobStorage(storage =>
{
storage.Settings.ConnectionString = builder.Configuration["ConnectionStrings:Storage"];
});
repositoryBuilder.WithBlobStorageCache(cacheStorage =>
{
cacheStorage.Settings.ConnectionString = builder.Configuration["ConnectionStrings:Storage"];
cacheStorage.Settings.ContainerName = "document-cache";
});
});
builder.Services.AddQuery<User, string>(queryBuilder =>
{
queryBuilder.WithBlobStorage(storage =>
{
storage.Settings.ConnectionString = builder.Configuration["ConnectionStrings:Storage"];
});
queryBuilder.WithBlobStorageCache(
cacheStorage =>
{
cacheStorage.Settings.ConnectionString = builder.Configuration["ConnectionStrings:Storage"];
cacheStorage.Settings.ContainerName = "user-query-cache";
},
cache =>
{
cache.ExpiringTime = TimeSpan.FromMinutes(30);
cache.Methods = RepositoryMethods.Get | RepositoryMethods.Query;
});
});
As with the base cache package, write caching on command-only registrations is meaningful only when Methods includes write flags.
builder.Services.AddCommand<User, string>(commandBuilder =>
{
commandBuilder.WithBlobStorage(storage =>
{
storage.Settings.ConnectionString = builder.Configuration["ConnectionStrings:Storage"];
});
commandBuilder.WithBlobStorageCache(
cacheStorage =>
{
cacheStorage.Settings.ConnectionString = builder.Configuration["ConnectionStrings:Storage"];
cacheStorage.Settings.ContainerName = "user-command-cache";
},
cache =>
{
cache.ExpiringTime = TimeSpan.FromMinutes(10);
cache.Methods = RepositoryMethods.Insert
| RepositoryMethods.Update
| RepositoryMethods.Delete;
});
});
You can stack the standard in-memory decorator in front of Blob Storage.
builder.Services.AddRepository<User, string>(repositoryBuilder =>
{
repositoryBuilder.WithBlobStorage(storage =>
{
storage.Settings.ConnectionString = builder.Configuration["ConnectionStrings:Storage"];
storage.Settings.ContainerName = "users";
});
repositoryBuilder.WithInMemoryCache(cache =>
{
cache.ExpiringTime = TimeSpan.FromSeconds(30);
cache.Methods = RepositoryMethods.Get | RepositoryMethods.Query;
});
repositoryBuilder.WithBlobStorageCache(
cacheStorage =>
{
cacheStorage.Settings.ConnectionString = builder.Configuration["ConnectionStrings:Storage"];
cacheStorage.Settings.ContainerName = "user-cache";
},
cache =>
{
cache.ExpiringTime = TimeSpan.FromMinutes(10);
cache.Methods = RepositoryMethods.All;
});
});
Read flow in that setup:
The Blob Storage cache adapter is intentionally small and inherits most behavior from the base cache package.
Important details from the source:
System.Text.JsonSetAsync(...) writes through UpdateAsync(...) on the internal blob repositoryUploadAsync(..., overwrite: true), cache writes behave like upsertsDeleteAsync(...) first checks whether the cache blob exists and then deletes itstringWithBlobStorageCache(...) accepts the same optional name parameter used across Repository Framework registrations.
That name is used for two different things:
IRepository<BlobStorageCacheModel, string> factory registration created for the cache backendThis means named registrations are supported, but the same caveats from the base cache package still apply:
Get and Exist cache keys include the factory nameQuery and Operation cache keys do not include the factory name in the current implementationIf you have multiple named registrations for the same model and they expose different data sources, avoid query caching or keep their cache backends physically separate.
This package uses DistributedCacheOptions<T, TKey> from Rystem.RepositoryFramework.Cache.
| Property | Default | Notes |
|---|---|---|
Methods |
Query | Get | Exist |
Enables read-through caching by default. |
ExpiringTime |
365 * 365 days |
Set this explicitly for production workloads. |
Relevant flags:
Get caches GetAsyncExist caches ExistAsyncQuery caches QueryAsync and OperationAsyncInsert, Update, and Delete keep key-based cache entries in syncAll enables every flagAs with the base cache package, write operations update Get and Exist entries for affected keys, but they do not invalidate previously cached query result sets.
The cache storage registration uses the same Blob Storage builder as the main Azure Blob infrastructure package, so you can configure:
ConnectionStringEndpointUriManagedIdentityClientIdContainerNamePrefixClientOptionsUsing a dedicated container like user-cache is usually easier to inspect and rotate than mixing cache blobs with domain blobs.
Use it when you want:
If you want the generic cache decorators without Blob Storage, start with ../RepositoryFramework.Cache/README.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.8 | 5,494 | 5/13/2026 |
| 10.0.7 | 127 | 3/26/2026 |
| 10.0.6 | 433,458 | 3/3/2026 |
| 10.0.5 | 123 | 2/22/2026 |
| 10.0.4 | 136 | 2/9/2026 |
| 10.0.3 | 147,902 | 1/28/2026 |
| 10.0.1 | 209,087 | 11/12/2025 |
| 9.1.3 | 269 | 9/2/2025 |
| 9.1.2 | 764,467 | 5/29/2025 |
| 9.1.1 | 97,831 | 5/2/2025 |
| 9.0.32 | 186,734 | 4/15/2025 |
| 9.0.31 | 5,813 | 4/2/2025 |
| 9.0.30 | 88,828 | 3/26/2025 |
| 9.0.29 | 9,037 | 3/18/2025 |
| 9.0.28 | 270 | 3/17/2025 |
| 9.0.27 | 291 | 3/16/2025 |
| 9.0.26 | 277 | 3/13/2025 |
| 9.0.25 | 52,153 | 3/9/2025 |
| 9.0.21 | 343 | 3/6/2025 |
| 9.0.20 | 19,625 | 3/6/2025 |