PowerCSharp.Feature.Cache.Disk 1.3.3

There is a newer version of this package available.
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" />
                    
Directory.Packages.props
<PackageReference Include="PowerCSharp.Feature.Cache.Disk" />
                    
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 PowerCSharp.Feature.Cache.Disk --version 1.3.3
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=PowerCSharp.Feature.Cache.Disk&version=1.3.3
                    
Install as a Cake Tool

PowerCSharp.Feature.Cache.Disk

PowerCSharp Banner

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) + IHostedService on 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 = true or call services.AddCacheDisk(configuration)

Namespaces

  • PowerCSharp.Feature.Cache.DiskDiskCacheService, DiskCacheFeatureOptions, AddCacheDisk, DiskCacheBackgroundService.
  • PowerCSharp.Feature.Cache.AbstractionsIDiskCacheService contract.
Product 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.

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.3.5 44 8/25/2026
1.3.3 112 7/23/2026
1.3.2 137 6/22/2026
1.3.1 160 6/22/2026