Xeku.Cache
0.0.0.7
dotnet add package Xeku.Cache --version 0.0.0.7
NuGet\Install-Package Xeku.Cache -Version 0.0.0.7
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="Xeku.Cache" Version="0.0.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xeku.Cache" Version="0.0.0.7" />
<PackageReference Include="Xeku.Cache" />
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 Xeku.Cache --version 0.0.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Xeku.Cache, 0.0.0.7"
#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 Xeku.Cache@0.0.0.7
#: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=Xeku.Cache&version=0.0.0.7
#tool nuget:?package=Xeku.Cache&version=0.0.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Xeku.Cache
A unified caching abstraction module for XAF applications with Memory and Redis backend support.
Features
- Multi-Backend Support: Memory cache (built-in) and Redis (optional).
- Unified API: Single
ICacheServiceinterface for all caching operations. - Cache Statistics: Track hit rate, miss rate, and other metrics.
- Penetration Protection: Null value caching to prevent database overload.
- Flexible Configuration: Customizable expiration, priorities, and key prefixes.
Architecture
graph LR
App[XAF Application] --> ICache[ICacheService]
ICache --> Stats[Statistics Provider]
ICache --> Provider{Cache Provider}
Provider --> Memory[Memory Cache]
Provider --> Redis[Redis Server]
style App fill:#e1f5fe
style Provider fill:#fff4e1
style Redis fill:#fce4ec
Installation
Add the module reference to your project:
1. NuGet Package
dotnet add package Xeku.Cache
Quick Start
1. Register Services
// Program.cs - Using Memory Cache (default)
builder.Services.AddXekuCache();
// Or using Redis
builder.Services.AddXekuCache("localhost:6379");
2. Usage in Services
public async Task<Product?> GetProductAsync(Guid id)
{
return await _cache.GetOrCreateAsync(
$"product:{id}",
async () => await _repository.GetByIdAsync(id),
CacheOptions.AbsoluteExpirationIn(TimeSpan.FromMinutes(10))
);
}
AI Agent Integration
Suggested Context
- Cache Strategy: Prefer
GetOrCreateAsyncto handle race conditions (Cache Aside pattern). - Key Naming: Always use colon-separated prefixes (e.g.,
feature:sub:id).
Common Tasks
- "Create a cache invalidation service for the 'User' entity."
- "Show me the current cache hit rate statistics."
License
MIT License
| 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
- DevExpress.ExpressApp (>= 25.2.3)
- Microsoft.Extensions.Caching.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- StackExchange.Redis (>= 2.8.58)
- System.Text.Json (>= 8.0.6)
- Xeku.Core (>= 0.0.0.7)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Xeku.Cache:
| Package | Downloads |
|---|---|
|
Xeku.FullTextSearch
XAF module for global full-text search across all business objects. |
|
|
Xeku.ApiKey
XAF module for API key generation and management with expiration support. |
|
|
Xeku.Keycloak.WebApi
Package Description |
|
|
Xeku.Sharing
XAF module for external data sharing via Magic Links with token-based access control. |
GitHub repositories
This package is not used by any popular GitHub repositories.