DistributedCache.AzureTableStorage
1.2.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package DistributedCache.AzureTableStorage --version 1.2.1
NuGet\Install-Package DistributedCache.AzureTableStorage -Version 1.2.1
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="DistributedCache.AzureTableStorage" Version="1.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DistributedCache.AzureTableStorage" Version="1.2.1" />
<PackageReference Include="DistributedCache.AzureTableStorage" />
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 DistributedCache.AzureTableStorage --version 1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DistributedCache.AzureTableStorage, 1.2.1"
#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.
#addin nuget:?package=DistributedCache.AzureTableStorage&version=1.2.1
#tool nuget:?package=DistributedCache.AzureTableStorage&version=1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DistributedCache.AzureTableStorage
- Based on oceanweb/azuretablestoragecache but with lower dependencies.
- Extra added logic to use strongly typed objects with IDistributedCache instead of byte arrays.
- Multiple versions are available, see table below for details.
Code example
Configure in code (option 1)
c# code:
// Configure in code
services.Configure<AzureTableStorageCacheOptions>(options =>
{
options.TableName = "CacheTest";
options.PartitionKey = "ConsoleApp";
options.ConnectionString = "UseDevelopmentStorage=true;";
options.ExpiredItemsDeletionInterval = TimeSpan.FromHours(24);
});
Notes
- If the TableName does not exists, it's created. If you want to disable this behaviour, set the
options.CreateTableIfNotExists
tofalse
. - When an item is retrieved or added to to the cache, a periodic interval scan can be done to find and delete expired items in the cache. Default this is set to
null
, which means that this functionality is disabled. If you want to change this, set theoptions.ExpiredItemsDeletionInterval
to a different value, likeTimeSpan.FromMinutes(30)
.
Configure via appsettings.json (option 2)
appsettings.json:
"AzureTableStorageCacheOptions": {
"ConnectionString": "UseDevelopmentStorage=true;",
"TableName": "CacheTest",
"PartitionKey": "ConsoleApp"
}
c# code:
// Configure via app.setttings
services.Configure<AzureTableStorageCacheOptions>(Configuration.GetSection("AzureTableStorageCacheOptions"));
Add DistributedAzureTableStorageCache to services
services.AddDistributedAzureTableStorageCache();
Usage
IDistributedCache cache = ... // injected via DI
var test = new TestModel
{
Id = 1,
Name = "Test 1"
};
// Set an item in the cache using an expiration from 30 seconds
var cacheOptions = new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(30) };
await cache.SetAsync("t1", test, cacheOptions);
// Retrieve the item from the cache
var t2 = await cache.GetAsync<TestModel>("t1");
logger.LogInformation("t2 : {TestModel}", JsonConvert.SerializeObject(t2));
Sponsors
Entity Framework Extensions and Dapper Plus are major sponsors and proud to contribute to the development of DistributedCache.AzureTableStorage.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Extensions.Caching.Abstractions (>= 2.1.1)
- Newtonsoft.Json.Bson (>= 1.0.3)
- Stef.Validation.Options (>= 0.2.0)
- WindowsAzure.Storage (>= 9.3.3)
- windowsazure.storageextensions (>= 1.3.0)
-
.NETStandard 2.1
- Microsoft.Extensions.Caching.Abstractions (>= 2.1.1)
- Newtonsoft.Json.Bson (>= 1.0.3)
- Stef.Validation.Options (>= 0.2.0)
- WindowsAzure.Storage (>= 9.3.3)
- windowsazure.storageextensions (>= 1.3.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DistributedCache.AzureTableStorage:
Package | Downloads |
---|---|
DataFunc.IMemoryCache.AzureTableStorage
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
3.3.1 | 1,476 | 6/17/2025 |
3.3.0 | 27,975 | 12/2/2024 |
3.2.0 | 108,533 | 5/10/2023 |
3.1.0 | 22,657 | 10/21/2022 |
3.1.0-preview-02 | 205 | 10/21/2022 |
3.1.0-preview-01 | 224 | 10/20/2022 |
3.0.1 | 10,635 | 7/12/2022 |
3.0.0-preview-01 | 184 | 6/18/2022 |
2.2.1 | 141 | 6/17/2025 |
2.2.1-preview | 127 | 6/17/2025 |
2.2.0 | 334 | 5/10/2023 |
2.2.0-preview | 286 | 5/10/2023 |
2.1.0 | 1,135 | 10/21/2022 |
2.1.0-preview | 186 | 10/21/2022 |
2.0.1 | 32,978 | 2/5/2021 |
2.0.1-preview | 295 | 2/5/2021 |
2.0.0 | 10,190 | 6/12/2020 |
2.0.0-preview-03 | 381 | 6/10/2020 |
2.0.0-preview-02 | 548 | 5/25/2020 |
2.0.0-preview-01 | 4,468 | 2/28/2020 |
1.2.1 | 133 | 6/17/2025 |
1.2.0 | 416 | 10/21/2022 |
1.1.0 | 1,455 | 6/12/2020 |
1.0.4 | 4,022 | 9/13/2019 |
1.0.3 | 1,046 | 2/15/2019 |
1.0.2 | 708 | 2/13/2019 |
1.0.1 | 724 | 2/9/2019 |
1.0.0 | 752 | 2/8/2019 |
1.0.0-preview-01 | 593 | 2/8/2019 |
See CHANGELOG.md