Aneiang.Yarp.Plugin.Cache
2.3.0.30
dotnet add package Aneiang.Yarp.Plugin.Cache --version 2.3.0.30
NuGet\Install-Package Aneiang.Yarp.Plugin.Cache -Version 2.3.0.30
<PackageReference Include="Aneiang.Yarp.Plugin.Cache" Version="2.3.0.30" />
<PackageVersion Include="Aneiang.Yarp.Plugin.Cache" Version="2.3.0.30" />
<PackageReference Include="Aneiang.Yarp.Plugin.Cache" />
paket add Aneiang.Yarp.Plugin.Cache --version 2.3.0.30
#r "nuget: Aneiang.Yarp.Plugin.Cache, 2.3.0.30"
#:package Aneiang.Yarp.Plugin.Cache@2.3.0.30
#addin nuget:?package=Aneiang.Yarp.Plugin.Cache&version=2.3.0.30
#tool nuget:?package=Aneiang.Yarp.Plugin.Cache&version=2.3.0.30
<div align="center"> <img src="cover-en.png" alt="Aneiang.Yarp — The reverse proxy & API gateway for .NET" width="100%"/>
<br/>
<img src="logo.png" alt="Aneiang.Yarp" width="240" style="border-radius: 15px;"/>
Aneiang.Yarp — Full-featured API Gateway powered by YARP
Plugin Architecture · Dashboard · Dynamic Routing · WAF · Service Discovery · AI Assistant · 2FA · IP Isolation
</div>
Aneiang.Yarp is a production-ready API gateway built on Microsoft YARP 2.3.0. It ships with everything you'd otherwise build yourself: a plugin architecture (11 built-in plugins), a visual management dashboard, WAF, AI assistant, multi-provider service discovery, notifications, health & circuit-breaker monitoring, and one-line client auto-registration.
📖 Documentation · 🚀 Live Demo admin / demo123
Aneiang.Yarp vs. Bare YARP
| Need | Bare YARP | Aneiang.Yarp |
|---|---|---|
| Management UI | Build your own | ✅ Included |
| Edit config at runtime | Reload file only | ✅ CRUD + form/JSON editor + rollback + audit |
| Security (WAF) | None | ✅ WAF plugin (IP allow/deny, SQLi, XSS, path traversal) |
| Microservice registration | None | ✅ One-line REST/gRPC + heartbeat recovery |
| Observability | Logging only | ✅ Metrics, request logs, health, circuit-breaker panel |
| Service discovery | Manual clusters | ✅ Consul / Nacos / Eureka / K8s / HTTP-JSON / Static |
| AI assistant | None | ✅ Chat-based management (40 tools, read/write split) |
| Extensibility | Custom middleware | ✅ Drop-in IGatewayPlugin framework |
Architecture
+-----------------------------------------------------------+
| Aneiang.Yarp Gateway (YARP 2.3.0) |
+-------------+ | +------------------+ +-------------------------------+ |
| 5+ clients | | | Web Dashboard | | Management API + gRPC host | |
| (browsers/ | | | Routes/Plugins | | Client auto-registration | |
| apps) |-->| | WAF / AI / 2FA | | | |
+-------------+ | +--------+----------+ +--------------+----------------+ |
| +------------------------------------------------+ |
| | |
| +--------v---------+ | |
| | Plugin Pipeline(11 built-in plugins) | |
| | WAF → RateLimit → Retry → CircuitBreaker → | |
| | Compression → Cache → Metrics → ProxyLog | |
| +--------+---------+ | |
| +------------------------------------------------+ |
| | |
| +--------v---------+ +-------------------------------+ |
| | YARP Reverse Proxy | → | Target services / clusters | |
| | (dynamic routes) | | (via Service Discovery) | |
| +--------+---------+ +-------------------------------+ |
| |
| +--------v--------+
| | Storage: SQLite (SQLCipher AES-256) |
+-----------------------------------------------------------+
Highlights
- Plugin architecture — everything is a plugin; 11 first-party plugins provide WAF, rate limiting, retry, circuit breaking, compression, caching, metrics and more. Bring your own
IGatewayPluginin minutes. - Visual dashboard — clusters, routes, plugins, WAF, health, circuit breakers, logs, notifications, audit trail and config history in one place.
- Runtime dynamic routing — create / edit clusters & routes without restarting; auto-persists and auto-recovers on restart.
- Native YARP config editing — dual-mode form + JSON editor that works directly on the standard YARP schema.
- Multi-provider service discovery — Consul, Nacos, Eureka, Kubernetes, HTTP-JSON, Static.
- One-line client registration — microservices register on startup and unregister on shutdown over REST or gRPC, with heartbeat self-healing.
- AI assistant — manage the gateway by chat; 40 Function-Calling tools with a strict read/write permission split.
- Flexible deployment —
Auto/AllInOne/Split/ProxyOnly/DashboardOnlywith role-based endpoints.
Quick Start
Minimal
dotnet add package Aneiang.Yarp
dotnet add package Aneiang.Yarp.Dashboard
dotnet add package Aneiang.Yarp.Storage.Sqlite
// Program.cs — Gateway
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAneiangYarp();
builder.Services.AddAneiangStorage();
builder.Services.AddAneiangYarpDashboard();
var app = builder.Build();
app.UseAneiangYarpDashboard(); // includes MapReverseProxy
app.Run();
Dashboard: http://localhost:5000/apigateway
Microservice — auto-registers on startup, no extra code:
dotnet add package Aneiang.Yarp.Client
builder.Services.AddAneiangYarpClient();
{ "Gateway": { "Registration": { "GatewayUrl": "http://localhost:5000" } } }
Recommended (multi-port + gRPC + hot reload)
var builder = WebApplication.CreateBuilder(args);
builder.UseYarpKestrelAutoConfig(); // multi-port / gRPC support
builder.Services.AddAneiangYarp();
builder.Services.AddAneiangStorage();
builder.Services.AddAneiangYarpDashboard();
builder.Services.AddAneiangYarpDeployment(); // deployment modes + health endpoints
var app = builder.Build();
app.UseAneiangYarpDashboard();
app.Run();
Full step-by-step guide: Quick Start
Package Structure
| Package | Purpose | YARP |
|---|---|---|
| Aneiang.Yarp | Gateway core: dynamic routing, IP isolation, API auth, plugin execution | ✅ |
| Aneiang.Yarp.Dashboard | Web admin panel + AI assistant | via core |
| Aneiang.Yarp.Client | One-line auto-registration (no YARP dependency) | ❌ |
| Aneiang.Yarp.Storage.Sqlite | SQLite storage with SQLCipher AES-256 | via storage |
| Aneiang.Yarp.Storage.Abstractions | Storage interfaces & entities | ❌ |
| Aneiang.Yarp.Grpc | gRPC registration protocol | ❌ |
| Aneiang.Yarp.Plugin.Abstractions | Plugin contract (IGatewayPlugin) |
❌ |
| Aneiang.Yarp.Plugin.* | 11 first-party plugins, pulled in individually | via core |
.NET 8.0 / 9.0.
Feature Overview
| Area | What you get | Detail |
|---|---|---|
| Routing | Dynamic clusters & routes, drag-sort priority, dual form/JSON editor, import/export, snapshot & rollback, audit log | :link: |
| Authentication | None / DefaultJwt / CustomJwt / ApiKey / custom delegate; TOTP 2FA |
:link: |
| Security | WAF: IP allow/deny, SQLi / XSS / path-traversal detection, request limits, security headers | :link: |
| Observability | Request logs (TraceID pairing, sanitization, sampling), real-time WebSocket stream | :link: |
| Monitoring | Request / latency / status metrics (P50/P90/P99), health checks, circuit-breaker panel | :link: |
| Notification | Webhook channels (DingTalk / HTTP), event rules with cooldown, delivery history | :link: |
| AI Assistant | Chat-based management, 40 tools, read/write permission split, streaming, multi-provider | :link: |
| IP Isolation | Route requests to a specific developer's instance by client IP for collaborative debugging | :link: |
| Client SDK | Auto-register / unregister, heartbeat recovery, GetServicesAsync / UpdateDestinationsAsync |
:link: |
| Extensibility | IGatewayPlugin contract, plugin-center management, hot-reconfigured bindings |
:link: |
| Config safety | Auto-snapshot, rollback, GET /api/config/apply-errors, SQLCipher-encrypted store |
:link: |
Service Discovery
ServiceDiscoveryRefreshService periodically resolves a cluster's destinations from a registry and publishes a new YARP snapshot — no restart. Bound per cluster (service-discovery plugin binding).
| Mode | Notes |
|---|---|
Static |
Fixed endpoint list |
HttpJson |
Generic HTTP endpoint returning JSON endpoints |
Consul |
Healthy-instance filtering |
Nacos |
healthyOnly filter + hosts resolution |
Eureka |
JSON + port.$ parsing + UP filtering |
Kubernetes |
ServiceAccount token + endpoints subsets |
Config: Mode (default Static), Endpoint, ServiceName, Namespace (default), Scheme (http), RefreshSeconds (30), RequestTimeoutSeconds (5).
Built-in Plugins
| ID | Scope | What it does |
|---|---|---|
waf |
Route | IP allow/deny, SQLi / XSS / path-traversal detection, request limits, security headers |
rate-limit |
Route | FixedWindow / SlidingWindow / TokenBucket / Concurrency |
rate-limit-redis |
Route | Distributed limiting via Redis Lua; 429 with Retry-After / X-RateLimit-* |
request-retry |
Route | Retry with exponential backoff + jitter, status/exception policy |
circuit-breaker |
Cluster | Failure threshold, recovery timeout, half-open probing |
compression |
Route | Gzip / Brotli by MIME allowlist + min size |
response-cache |
Route | Bounded in-memory cache with TTL & vary key |
traffic-metrics |
Route | Per-route requests / errors / latency / bytes |
cluster-metrics |
Cluster | Per-cluster requests / errors / latency / destinations |
proxy-log |
Route | Full proxy capture (headers / optional body), sampling |
service-discovery |
Cluster | Periodic registry-backed endpoint refresh |
Documentation
Full documentation lives at yarp.aneiang.com.
- Getting Started — Overview · Quick Start
- Gateway Core — Authentication · Dynamic Routing · IP Isolation · Configuration Reference
- Dashboard — Dashboard Overview · Config History
- Security — WAF Firewall · Policy Management
- Monitoring — Health Check · Circuit Breaker · Rate Limiting · Request Logs · Request Retry · Notifications
- Plugins & Pipeline — Plugin System · Middleware Pipeline
- Client SDK — Client Registration
- AI Assistant — AI Assistant
- Advanced — Deployment Modes · Custom Auth · Production Config
- Storage — SQLite Storage
Contributing
We welcome contributions!
- Fork the repo and create a feature branch (
git checkout -b feature/your-feature). - Commit with a clear message describing the change and its purpose.
- Keep the API surface stable — new features should ideally be added as plugins.
- For new plugins, follow the
IGatewayPluginmanifest conventions (id, display name, version, scope, capabilities) and provide a JSON Schema. - When changing Dashboard strings, update both
zh-CNanden-USlanguage packs. - Build the solution with 0 warnings / 0 errors before submitting a Pull Request.
Report bugs and feature requests via GitHub Issues. All first-party packages are MIT-licensed.
NuGet
| Package | NuGet |
|---|---|
| Aneiang.Yarp | |
| Aneiang.Yarp.Dashboard | |
| Aneiang.Yarp.Client | |
| Aneiang.Yarp.Storage.Abstractions | |
| Aneiang.Yarp.Storage.Sqlite | |
| Aneiang.Yarp.Grpc | |
| Aneiang.Yarp.Plugin.Abstractions |
.NET 8.0 / 9.0 · YARP 2.3.0
License
<div align="center" style="display: flex; justify-content: center; align-items: center; gap: 20px; background: #f6f8fa; padding: 20px 30px; border-radius: 12px; border: 1px solid #e1e4e8; box-shadow: 0 2px 8px rgba(0,0,0,0.05);"> <img src="docs/wechat_qrcode.jpg" alt="Official Account QR Code" style="width: 140px; height: 140px; border-radius: 8px; border: 2px solid #d0d7de;" /> <div style="text-align: left;"> <h3 style="margin: 0 0 4px 0; font-size: 22px; font-weight: 600; color: #24292e;"> 递归不爆炸 </h3> <p style="margin: 0; font-size: 16px; color: #586069; max-width: 280px;"> Scan to follow and get more great content </p> </div> </div>
<div align="center">
If this project helps you, ⭐ Star it to support development
</div>
| 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 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. |
-
net8.0
- Aneiang.Yarp (>= 2.3.0.30)
- Aneiang.Yarp.Plugin.Abstractions (>= 2.3.0.30)
- Yarp.ReverseProxy (>= 2.3.0)
-
net9.0
- Aneiang.Yarp (>= 2.3.0.30)
- Aneiang.Yarp.Plugin.Abstractions (>= 2.3.0.30)
- Yarp.ReverseProxy (>= 2.3.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Aneiang.Yarp.Plugin.Cache:
| Package | Downloads |
|---|---|
|
Aneiang.Yarp.Dashboard
YARP gateway dashboard UI with authorization, real-time cluster/routes monitoring and log viewer. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.0.30 | 110 | 9/20/2026 |
| 2.3.0.30-preview.1 | 83 | 8/30/2026 |