PowerCSharp.Feature.Cache.Disk
1.3.3
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 PowerCSharp.Feature.Cache.Disk --version 1.3.3
NuGet\Install-Package PowerCSharp.Feature.Cache.Disk -Version 1.3.3
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="PowerCSharp.Feature.Cache.Disk" Version="1.3.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PowerCSharp.Feature.Cache.Disk" Version="1.3.3" />
<PackageReference Include="PowerCSharp.Feature.Cache.Disk" />
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 PowerCSharp.Feature.Cache.Disk --version 1.3.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PowerCSharp.Feature.Cache.Disk, 1.3.3"
#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 PowerCSharp.Feature.Cache.Disk@1.3.3
#: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=PowerCSharp.Feature.Cache.Disk&version=1.3.3
#tool nuget:?package=PowerCSharp.Feature.Cache.Disk&version=1.3.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
PowerCSharp.Feature.Cache.Disk

Disk-backed LRU cache implementation for the PowerCSharp Cache feature.
- Targets
net8.0, so it runs on .NET 8.0 and later. - Atomic writes (temp file +
File.Move) so readers never see partial files. - LRU eviction with configurable count cap and TTL expiry.
- Background cleanup via portable timer (all TFMs) +
IHostedServiceon net8.0 for graceful shutdown. - Single JSON index file for fast lookups.
- Cross-process file-lock coordination (configurable).
Usage
services.AddCacheDisk(configuration);
Configuration section:
{
"PowerFeatures": {
"DiskCache": {
"DirectoryPath": "/path/to/cache",
"DefaultTtlSeconds": 3600,
"MaxEntries": 10000,
"EnableBackgroundCleanup": true,
"CleanupIntervalSeconds": 300,
"EnableCrossProcessLocking": false
}
}
}
Manual control
var disk = serviceProvider.GetRequiredService<IDiskCacheService>();
await disk.SetAsync("key", value);
var result = await disk.GetAsync<MyType>("key");
For manual eviction/expiry:
var cache = (DiskCacheService)disk;
cache.PurgeExpired();
cache.EvictToLimit();
Details
- Package ID:
PowerCSharp.Feature.Cache.Disk - Depends on:
PowerCSharp.Feature.Cache.Abstractions(+PowerCSharp.Core,PowerCSharp.Helpers,PowerCSharp.Extensions) - Target framework:
net8.0 - Activate:
PowerFeatures:DiskCache:Enabled = trueor callservices.AddCacheDisk(configuration)
Namespaces
PowerCSharp.Feature.Cache.Disk—DiskCacheService,DiskCacheFeatureOptions,AddCacheDisk,DiskCacheBackgroundService.PowerCSharp.Feature.Cache.Abstractions—IDiskCacheServicecontract.
| 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 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.
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- PowerCSharp.Core (>= 2.0.2)
- PowerCSharp.Extensions (>= 2.0.2)
- PowerCSharp.Feature.Cache.Abstractions (>= 1.3.3)
- PowerCSharp.Features.Abstractions (>= 1.0.2)
- PowerCSharp.Helpers (>= 2.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.