ServcoX.SimpleSharedCache
1.4.0
dotnet add package ServcoX.SimpleSharedCache --version 1.4.0
NuGet\Install-Package ServcoX.SimpleSharedCache -Version 1.4.0
<PackageReference Include="ServcoX.SimpleSharedCache" Version="1.4.0" />
<PackageVersion Include="ServcoX.SimpleSharedCache" Version="1.4.0" />
<PackageReference Include="ServcoX.SimpleSharedCache" />
paket add ServcoX.SimpleSharedCache --version 1.4.0
#r "nuget: ServcoX.SimpleSharedCache, 1.4.0"
#:package ServcoX.SimpleSharedCache@1.4.0
#addin nuget:?package=ServcoX.SimpleSharedCache&version=1.4.0
#tool nuget:?package=ServcoX.SimpleSharedCache&version=1.4.0
ServcoX.SimpleSharedCache
Introduction
Need a simple way to cache data? Need it to persist between application restarts and be shared between servers? Need it to be cheap? SimpleSharedCache is for you.
SimpleSharedCache persists data in Azure Blob Storage, so it's super cheap, reliable and quite fast.
Installation
Grab it from NuGet from dotnet add package ServcoX.SimpleSharedCache
.
How do I make it go?
Define what you want to cache. Something like this:
public record TestRecord(String Body);
Instantiate the cache like so:
var cache = new SimpleSharedCacheClient("=== onnection string goes here ===");
Write your record:
var record = new TestRecord("Something to cache");
await cache.Set(key, record);
Any server can then retrieve the record:
var record = await cache.Get<TestRecord>(key);
Console.WriteLine(record.Body); // Outputs "Something to cache"
If you want, you can retrieve all records of a given type too:
var records = await cache.List<TestRecord>();
How is the cache keyed?
Records are stored using a combination of the records key
that you provide, along with a hash of the
records schema. For instance, in the example above if I add/rename/delete a field in TestRecord
it
will be seen as a different record.
For those with blue-green deployments this means you can modify your records and deploy without worring that the schema change will cause deserialization or other quirky issues.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 was computed. 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 was computed. 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. |
-
net7.0
- Azure.Storage.Blobs (>= 12.19.1)
- ServcoX.Rfc7515C (>= 1.2.0)
-
net8.0
- Azure.Storage.Blobs (>= 12.19.1)
- ServcoX.Rfc7515C (>= 1.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.