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" />
                    
Directory.Packages.props
<PackageReference Include="Xeku.Cache" />
                    
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 Xeku.Cache --version 0.0.0.7
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=Xeku.Cache&version=0.0.0.7
                    
Install as a Cake Tool

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 ICacheService interface 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 GetOrCreateAsync to 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 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 (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.

Version Downloads Last Updated
0.0.0.7 298 1/28/2026
0.0.0.6 257 1/21/2026
0.0.0.5 237 1/15/2026
0.0.0.4 244 1/13/2026
0.0.0.3 246 1/9/2026
0.0.0.2 201 1/8/2026