ServcoX.SimpleSharedCache 1.4.0

dotnet add package ServcoX.SimpleSharedCache --version 1.4.0
                    
NuGet\Install-Package ServcoX.SimpleSharedCache -Version 1.4.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ServcoX.SimpleSharedCache" Version="1.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ServcoX.SimpleSharedCache" Version="1.4.0" />
                    
Directory.Packages.props
<PackageReference Include="ServcoX.SimpleSharedCache" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ServcoX.SimpleSharedCache --version 1.4.0
                    
#r "nuget: ServcoX.SimpleSharedCache, 1.4.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ServcoX.SimpleSharedCache@1.4.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ServcoX.SimpleSharedCache&version=1.4.0
                    
Install as a Cake Addin
#tool nuget:?package=ServcoX.SimpleSharedCache&version=1.4.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.0 1,251 3/5/2024
1.3.1 790 1/16/2024
1.3.0 129 1/16/2024
1.2.0 243 1/11/2024
1.1.0 359 12/29/2023
1.0.0 157 12/29/2023