Aj.DCache 1.0.34

dotnet add package Aj.DCache --version 1.0.34
                    
NuGet\Install-Package Aj.DCache -Version 1.0.34
                    
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="Aj.DCache" Version="1.0.34" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aj.DCache" Version="1.0.34" />
                    
Directory.Packages.props
<PackageReference Include="Aj.DCache" />
                    
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 Aj.DCache --version 1.0.34
                    
#r "nuget: Aj.DCache, 1.0.34"
                    
#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 Aj.DCache@1.0.34
                    
#: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=Aj.DCache&version=1.0.34
                    
Install as a Cake Addin
#tool nuget:?package=Aj.DCache&version=1.0.34
                    
Install as a Cake Tool

Aj.DCache

🚀 Aj.DCache é uma biblioteca .NET para gerenciamento de cache distribuído, construída sobre DragonflyDB (compatível com Redis) e projetada para ser segura, escalável e fácil de integrar em ambientes de alta concorrência.


✨ Funcionalidades

  • Suporte completo ao protocolo Redis, DragonflyDB e KeyDB
  • Operações padrão de cache distribuído (get/set/remove)
  • Suporte ao padrão Lazy Caching (GetOrCreate)
  • Evita duplicidade com SETNX (gravação segura)
  • Integração simples com ILogger (compatível com Serilog)
  • Preparado para lock distribuído usando RedLock
  • Estrutura enxuta e amigável para múltiplos projetos .NET
  • 100% thread-safe
  • Preparado para uso em multi-tenancy

📦 Instalação

via NuGet:

dotnet add package Aj.DCache

🚀 Primeiros passos

Configure no Program.cs ou Startup.cs:

builder.Services.AddAjDCacheServices(configuration);

Exemplo de uso do cache:

var result = await DistributedCacheHelper.GetOrCreateAsync<MyObject>(
    key: "meu-cache",
    factory: async () => await ObterDoBanco(),
    expiration: TimeSpan.FromMinutes(5)
);

⚙️ Configuração do Redis / Dragonfly

No seu appsettings.json:

"AjDCacheOptions": {
  "Server": "localhost:6379,password=suasenha",
  "Environment": "Production",
  "ExpirationTimeout": 300,
  "LockTimeout": 3,
  "PollyRetryPolicy": 3,
  "UseCompression": true,
  "DataBaseId":
}

🛠️ Dependências


✅ Roadmap

  • Implementar lock distribuído (Redlock)
  • Suporte a cluster multi-node
  • Benchmarks comparativos
  • Documentação avançada
  • Melhorias no suporte a multi-tenancy

🤝 Contribuindo

Pull requests são muito bem-vindos! Abra uma issue ou envie sugestões para evoluirmos juntos.


📄 Licença

🎯 Baixe o arquivo pronto no link abaixo:

Download README.md


Estrutra do Projeto


Aj.DCache
│
├── Configuration
│     └── AjDCacheOptions.cs
│
├── Extensions
│     └── MemoryCacheExtensions.cs
│
├── Helpers
│     └── CompressionHelper.cs
│     └── DistributedLockHelper.cs
│
├── Interfaces
│     └── IAjMemoryCache.cs
│
├── Model
│     └── CacheEntry.cs
│
├── Providers
│     └── AjMemoryCache.cs
│     └── DistributedCacheProvider.cs
│
└── Services
      └── RedisCacheService.cs

Resumo

  • Interfaces → apenas contratos (IAjMemoryCache, ILockProvider, etc)

  • Providers → implementações concretas desses contratos

  • Services → serviços de alto nível que coordenam regras

  • Helpers → utilitários

  • Extensions → métodos de extensão

  • Model → DTOs/POCOs


Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on Aj.DCache:

Package Downloads
Aj.RabbitMQ.Core

Biblioteca .NET moderna para facilitar a integração de aplicações e microsserviços com RabbitMQ, incluindo suporte a padrões de Retry, Dead-Letter Queue, multi-tenant e envelopes padronizados de mensagens.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.34 138 6/5/2026
1.0.33 830 4/24/2026
1.0.32 794 3/20/2026
1.0.31 421 3/20/2026
1.0.30 509 3/11/2026
1.0.29 611 2/23/2026
1.0.28 1,084 1/26/2026
1.0.27 475 1/25/2026
1.0.26 465 1/25/2026
1.0.25 1,008 1/14/2026
1.0.24 499 1/14/2026
1.0.23 516 1/13/2026
1.0.22 477 1/13/2026
1.0.21 563 1/2/2026
1.0.20 553 11/26/2025
1.0.19 187 11/26/2025
1.0.18 199 11/24/2025
1.0.17 320 11/8/2025
1.0.16 301 11/4/2025
1.0.15 207 11/3/2025
Loading failed

Versão inicial do Aj.DCache com suporte a MemoryCache Local, Redis e DistributedCache Hibrido.