https://github.com/haxxornulled/vapecache
Redis-first caching runtime for .NET 10 with hybrid failover, stampede protection, and deep observability.
https://github.com/haxxornulled/vapecache
aspire aspnetcore caching circuit-breaker csharp distributed-cache dotnet dotnet10 high-performance hybrid-cache nuget opentelemetry performance redis resilience
Last synced: 18 days ago
JSON representation
Redis-first caching runtime for .NET 10 with hybrid failover, stampede protection, and deep observability.
- Host: GitHub
- URL: https://github.com/haxxornulled/vapecache
- Owner: haxxornulled
- License: other
- Created: 2025-12-21T13:57:26.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-08T16:31:34.000Z (22 days ago)
- Last Synced: 2026-03-08T20:31:56.063Z (22 days ago)
- Topics: aspire, aspnetcore, caching, circuit-breaker, csharp, distributed-cache, dotnet, dotnet10, high-performance, hybrid-cache, nuget, opentelemetry, performance, redis, resilience
- Language: C#
- Homepage: https://vapecache.com
- Size: 54.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# VapeCache
VapeCache is a Redis-first caching runtime for ASP.NET Core and .NET services.
It is designed for predictable behavior under load, Redis trouble, and high-throughput API traffic.
- Redis transport tuned for cache workloads
- Circuit-breaker and in-memory fallback for outage tolerance
- Stampede controls for hot keys
- OpenTelemetry metrics + traces
- ASP.NET Core and Aspire integrations
OSS scope in this repository: production-ready runtime packages for core caching, invalidation, ASP.NET Core integration, and Aspire integration.
## QuickStart
1. Install packages
```bash
dotnet add package VapeCache
dotnet add package VapeCache.Extensions.Aspire
```
If you need ASP.NET Core output-cache middleware integration:
```bash
dotnet add package VapeCache.Extensions.AspNetCore
```
2. Run Redis
```bash
docker run --name vapecache-redis -p 6379:6379 -d redis:7
```
3. Configure `appsettings.json`
```json
{
"RedisConnection": {
"Host": "localhost",
"Port": 6379,
"Database": 0
},
"CacheStampede": {
"Profile": "Balanced"
}
}
```
4. Register VapeCache in `Program.cs`
```csharp
using VapeCache.Abstractions.Caching;
using VapeCache.Abstractions.Connections;
using VapeCache.Infrastructure.Caching;
using VapeCache.Infrastructure.Connections;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOptions()
.Bind(builder.Configuration.GetSection("RedisConnection"));
builder.Services.AddVapecacheRedisConnections();
builder.Services.AddVapecacheCaching();
builder.Services.AddOptions()
.UseCacheStampedeProfile(CacheStampedeProfile.Balanced)
.Bind(builder.Configuration.GetSection("CacheStampede"));
```
5. Add one endpoint
```csharp
var app = builder.Build();
app.MapGet("/products/{id:int}", async (int id, IVapeCache cache, CancellationToken ct) =>
{
var key = CacheKey.From($"products:{id}");
var value = await cache.GetOrCreateAsync(
key,
_ => new ValueTask($"product-{id}"),
new CacheEntryOptions(TimeSpan.FromMinutes(5)),
ct);
return Results.Ok(value);
});
app.Run();
```
6. Go deeper: [docs/QUICKSTART.md](docs/QUICKSTART.md)
## Production Packages (OSS)
| Package | Purpose |
|---|---|
| `VapeCache` | Core runtime, Redis transport, fallback behavior, telemetry |
| `VapeCache.Abstractions` | Public contracts and option/value types |
| `VapeCache.Features.Invalidation` | Optional key/tag/zone invalidation policies |
| `VapeCache.Extensions.AspNetCore` | ASP.NET Core output-cache integration |
| `VapeCache.Extensions.Aspire` | Aspire wiring, health checks, endpoint helpers |
## Out Of OSS Scope
The following are not shipped from this OSS repository:
- enterprise licensing and control-plane features
- durable spill persistence package
- reconciliation package for post-outage write replay
## Documentation
- [docs/INDEX.md](docs/INDEX.md)
- [docs/QUICKSTART.md](docs/QUICKSTART.md)
- [docs/CONFIGURATION.md](docs/CONFIGURATION.md)
- [docs/SETTINGS_REFERENCE.md](docs/SETTINGS_REFERENCE.md)
- [docs/CACHE_INVALIDATION.md](docs/CACHE_INVALIDATION.md)
- [docs/ASPNETCORE_PIPELINE_CACHING.md](docs/ASPNETCORE_PIPELINE_CACHING.md)
- [docs/ASPIRE_INTEGRATION.md](docs/ASPIRE_INTEGRATION.md)
## Build And Test
```bash
dotnet build VapeCache.slnx -c Release
dotnet test VapeCache.Tests/VapeCache.Tests.csproj -c Release
```
## License
- Community/non-commercial usage: [LICENSE](LICENSE)
- Commercial usage: enterprise license required