EffinitiveFramework.Core
2.7.0
See the version list below for details.
dotnet add package EffinitiveFramework.Core --version 2.7.0
NuGet\Install-Package EffinitiveFramework.Core -Version 2.7.0
<PackageReference Include="EffinitiveFramework.Core" Version="2.7.0" />
<PackageVersion Include="EffinitiveFramework.Core" Version="2.7.0" />
<PackageReference Include="EffinitiveFramework.Core" />
paket add EffinitiveFramework.Core --version 2.7.0
#r "nuget: EffinitiveFramework.Core, 2.7.0"
#:package EffinitiveFramework.Core@2.7.0
#addin nuget:?package=EffinitiveFramework.Core&version=2.7.0
#tool nuget:?package=EffinitiveFramework.Core&version=2.7.0
EffinitiveFramework
A C# web framework built from scratch, implementing HTTP/1.1, HTTP/2 and HTTP/3 directly rather than layering on an existing server.
๐ Performance Goals
- Zero-allocation routing using
Span<T>andMemory<T> - Minimal overhead for request/response handling
- Optimized hot paths with aggressive inlining
- Efficient memory management using
ArrayPool<T> - Compile-time optimization for endpoint registration
๐ฆ Features
- Simple, intuitive API similar to FastEndpoints
- Type-safe endpoints with generic request/response handling
- Multiple endpoint types - Optimized for sync, async I/O, and streaming operations
EndpointBase<TRequest, TResponse>- Synchronous/cached operations (ValueTask)AsyncEndpointBase<TRequest, TResponse>- Async I/O operations (Task)NoRequestEndpointBase<TResponse>- Endpoints without request body (GET, health checks)NoRequestAsyncEndpointBase<TResponse>- Async endpoints without request body
- Server-Sent Events (SSE) - Real-time streaming with three endpoint patterns:
NoRequestSseEndpointBase- Simple streaming without request bodySseEndpointBase<TRequest>- Streaming with request parsingSseEndpointBase<TRequest, TEventData>- Strongly-typed event streaming
- WebSocket support (RFC 6455) - Full bidirectional messaging with
MapWebSocket()orWebSocketEndpointBase - Static file serving - Zero per-request I/O via in-memory
FrozenDictionarycache, 25+ MIME types - Response compression - Gzip middleware with single-pass serialize+compress pipeline
- Response caching - Opt-in
[ResponseCache]middleware serving repeat GETs from memory, withCache-Control/Vary/Ageheaders, ETag revalidation, and write-through invalidation (docs) - OpenAPI / Swagger -
UseOpenApi()serves an OpenAPI 3.0.3 document and Swagger UI, generated once at startup from the route table with zero per-request cost (docs) - Rate limiting -
UseRateLimiting()applies a token-bucket allowance per client IP with[RateLimit]/[DisableRateLimit]overrides, bounded memory, and reverse-proxy support (docs) - Custom HTTP server with direct socket handling for maximum performance
- High-performance transport layer -
IOQueue/SocketSenderPoolarchitecture mirroring Kestrel's design - HTTP/2 support via ALPN negotiation with binary framing and HPACK compression
- HTTP/3 / QUIC (experimental, .NET 10+) - RFC 9114 with QPACK compression, automatic alongside HTTPS
- HTTP/1.1 protocol - Battle-tested and optimized for speed
- TLS/HTTPS support with configurable certificates and modern protocol support
- Minimal allocations in hot code paths
- Benchmark suite included for performance validation
๐ Protocol Support
- โ HTTP/1.1 - Fully supported with custom parser (sub-50ฮผs response times)
- โ HTTPS/TLS - Full TLS 1.2/1.3 support with certificate configuration
- โ HTTP/2 - Complete implementation with binary framing, HPACK, stream multiplexing, and ALPN
- โ
HTTP/3/QUIC - Experimental, .NET 10+ only (RFC 9114 with QPACK, automatic when
QuicListener.IsSupported) - โ WebSocket - RFC 6455, full framing/fragmentation/ping-pong/close handshake
HTTP/2 Implementation
EffinitiveFramework includes a complete from-scratch HTTP/2 implementation:
- Binary framing layer - All 9 frame types (DATA, HEADERS, SETTINGS, PING, GOAWAY, etc.)
- HPACK compression - Static table (61 entries) + dynamic table + Huffman encoding
- Stream multiplexing - Multiple concurrent requests over single TCP connection
- Flow control - Per-stream and connection-level window management
- ALPN negotiation - Automatic protocol selection during TLS handshake ("h2" or "http/1.1")
- Settings management - Dynamic configuration via SETTINGS frames
HTTP/2 is automatically enabled for HTTPS connections when clients negotiate it via ALPN. See HTTP/2 Implementation Guide for details.
HTTP/3 Implementation (.NET 10+)
When targeting .NET 10 and TLS is configured, EffinitiveFramework starts a QUIC listener on the same HTTPS port:
- RFC 9114 - HTTP/3 framing (DATA, HEADERS, SETTINGS, GOAWAY)
- QPACK compression (RFC 9204) - Header encoding/decoding with static table and encoder/decoder streams
- Control streams - Bidirectional and unidirectional stream management
- Automatic - No extra configuration required; QUIC starts when
QuicListener.IsSupportedis true
WebSocket Implementation (RFC 6455)
- Full frame support - Text, Binary, Ping, Pong, Close, Continuation frames
- Fragmentation - Multi-frame messages transparently reassembled
- Keep-alive - Automatic Pong replies to client Ping frames
- Close handshake - Graceful connection termination with status codes
- Fluent registration -
MapWebSocket(path, handler)or subclassWebSocketEndpointBase
๐๏ธ Architecture
Core Components
- EffinitiveApp - Main application bootstrap
- Router - High-performance routing engine using zero-allocation techniques
- EndpointBase<TRequest, TResponse> - Base class for synchronous/cached operations (ValueTask)
- AsyncEndpointBase<TRequest, TResponse> - Base class for I/O operations (Task)
- IEndpoint - Core endpoint interfaces
Performance Optimizations
- Span-based routing - Routes are matched using
ReadOnlySpan<char>to avoid string allocations - Smart async handling -
ValueTask<T>for sync operations,Task<T>for I/O - Struct types - Key data structures use structs where appropriate
- ArrayPool - Reuses arrays for temporary operations
- Unsafe blocks enabled - Allows for low-level optimizations where needed
๐ Quick Start
1. Create an Endpoint
For simple GET endpoints without request body (use NoRequestEndpointBase):
using EffinitiveFramework.Core;
public class HealthCheckEndpoint : NoRequestEndpointBase<HealthResponse>
{
protected override string Method => "GET";
protected override string Route => "/api/health";
public override ValueTask<HealthResponse> HandleAsync(
CancellationToken cancellationToken = default)
{
return ValueTask.FromResult(new HealthResponse
{
Status = "Healthy",
Timestamp = DateTime.UtcNow,
Version = "2.0.0"
});
}
}
For in-memory/cached operations with request body (use EndpointBase):
using EffinitiveFramework.Core;
public class GetUsersEndpoint : EndpointBase<EmptyRequest, UsersResponse>
{
protected override string Method => "GET";
protected override string Route => "/api/users";
public override ValueTask<UsersResponse> HandleAsync(
EmptyRequest request,
CancellationToken cancellationToken = default)
{
var users = new List<User>
{
new User { Id = 1, Name = "Alice", Email = "alice@example.com" },
new User { Id = 2, Name = "Bob", Email = "bob@example.com" }
};
return ValueTask.FromResult(new UsersResponse { Users = users });
}
}
For database/I/O operations (use AsyncEndpointBase):
using EffinitiveFramework.Core;
public class CreateUserEndpoint : AsyncEndpointBase<CreateUserRequest, UserResponse>
{
protected override string Method => "POST";
protected override string Route => "/api/users";
public override async Task<UserResponse> HandleAsync(
CreateUserRequest request,
CancellationToken cancellationToken = default)
{
// True async I/O - database insert
var user = await _dbContext.Users.AddAsync(new User
{
Name = request.Name,
Email = request.Email
}, cancellationToken);
await _dbContext.SaveChangesAsync(cancellationToken);
return new UserResponse { User = user, Success = true };
}
}
For real-time Server-Sent Events streaming (use SSE endpoints):
using EffinitiveFramework.Core.Http.ServerSentEvents;
public class ServerTimeEndpoint : NoRequestSseEndpointBase
{
protected override string Method => "GET";
protected override string Route => "/api/stream/time";
protected override async Task HandleStreamAsync(
SseStream stream,
CancellationToken cancellationToken)
{
// Start automatic keep-alive pings
_ = stream.StartKeepAliveAsync(TimeSpan.FromSeconds(15), cancellationToken);
await stream.WriteAsync("connected", "Server time stream started");
while (!cancellationToken.IsCancellationRequested)
{
var timeData = new { Time = DateTime.UtcNow, Zone = "UTC" };
await stream.WriteJsonAsync(timeData, cancellationToken);
await Task.Delay(1000, cancellationToken);
}
}
}
Define your DTOs:
public record UsersResponse
{
public List<User> Users { get; init; } = new();
}
public record User
{
public int Id { get; init; }
public string Name { get; init; } = string.Empty;
public string Email { get; init; } = string.Empty;
}
๐ก See Endpoint Selection Guide for detailed guidance on choosing between
EndpointBaseandAsyncEndpointBase
For WebSocket connections (use MapWebSocket or subclass WebSocketEndpointBase):
using EffinitiveFramework.Core.WebSocket;
// Inline handler
app.MapWebSocket("/ws/echo", async (conn, ct) =>
{
while (conn.IsOpen)
{
var msg = await conn.ReceiveAsync(ct);
if (msg == null) break;
await conn.SendAsync(msg.Value.Data, msg.Value.Type, ct);
}
});
// Class-based handler
public class EchoEndpoint : WebSocketEndpointBase
{
public override string Route => "/ws/echo";
public override async Task OnConnectedAsync(
WebSocketConnection connection, CancellationToken cancellationToken)
{
while (connection.IsOpen)
{
var msg = await connection.ReceiveAsync(cancellationToken);
if (msg == null) break;
await connection.SendAsync(msg.Value.Data, msg.Value.Type, cancellationToken);
}
}
}
2. Bootstrap the Application
using EffinitiveFramework.Core;
var cts = new CancellationTokenSource();
Console.CancelKeyPress += (s, e) => { e.Cancel = true; cts.Cancel(); };
// Create the app, configure ports, TLS, services and endpoints, then build
var app = EffinitiveApp
.Create()
.UsePort(5000) // HTTP on port 5000
.UseHttpsPort(5001) // HTTPS on port 5001 (HTTP/2 + HTTP/3 via ALPN/QUIC)
.ConfigureTls(tls =>
{
tls.CertificatePath = "localhost.pfx";
tls.CertificatePassword = "dev-password";
})
.UseResponseCompression() // Enable gzip for supported clients
.UseStaticFiles("wwwroot") // Serve files from ./wwwroot at /static
.MapWebSocket("/ws", async (conn, ct) => // WebSocket endpoint
{
while (conn.IsOpen)
{
var msg = await conn.ReceiveAsync(ct);
if (msg != null) await conn.SendAsync(msg.Value.Data, msg.Value.Type, ct);
}
})
.MapEndpoints() // Automatically discovers and registers all endpoints
.Build();
// Run the server until cancelled
await app.RunAsync(cts.Token);
Dependency Injection (Configure services)
EffinitiveFramework exposes a light-weight DI integration via ConfigureServices on the builder. Use it to register DbContexts, services and middleware dependencies.
var app = EffinitiveApp.Create()
.ConfigureServices(services =>
{
// Register a scoped EF Core DbContext
services.AddScoped<AppDbContext>(sp =>
{
var options = new DbContextOptionsBuilder<AppDbContext>()
.UseSqlite("Data Source=products.db")
.Options;
return new AppDbContext(options);
});
// Register application services
services.AddScoped<IProductService, ProductService>();
services.AddScoped<IOrderService, OrderService>();
})
.MapEndpoints(typeof(Program).Assembly)
.Build();
// Resolve a scope for initialization or background work
using var scope = ((EffinitiveFramework.Core.DependencyInjection.ServiceProvider)app.Services!).CreateScope();
var ctx = scope.ServiceProvider.GetService<AppDbContext>();
3. Run the Application
dotnet run --project samples/EffinitiveFramework.Sample
The API will be available at http://localhost:5000 (or as configured).
๐งช Running Benchmarks
dotnet run --project benchmarks/EffinitiveFramework.Benchmarks -c Release
The benchmark suite compares:
- Route matching performance
- Endpoint invocation overhead
- Memory allocations
- Request/response throughput
๐ฏ Benchmark Results
Run the suite yourself on your own hardware and workload; that is the only measurement that tells you anything about your case.
BENCHMARK_RESULTS.md records an earlier comparison, kept for history. Those figures were taken on .NET 8 and do not describe the current build, which targets .NET 10.
๐ Project Structure
EffinitiveFramework/
โโโ src/
โ โโโ EffinitiveFramework.Core/ # Core framework library
โ โโโ EffinitiveApp.cs # Main application class + fluent builder
โ โโโ Router.cs # High-performance router (FrozenDictionary)
โ โโโ EndpointBase.cs # Base endpoint classes
โ โโโ IEndpoint.cs # Endpoint interfaces
โ โโโ Http/ # HTTP/1.1 parsing and response writing
โ โโโ Http2/ # HTTP/2 framing, HPACK, stream multiplexing
โ โโโ Http3/ # HTTP/3 / QUIC + QPACK (.NET 10+ only)
โ โโโ WebSocket/ # RFC 6455 WebSocket framing and endpoints
โ โโโ StaticFiles/ # In-memory static file handler
โ โโโ Transport/ # IOQueue, SocketSenderPool, DuplexPipe
โ โโโ Middleware/ # Pipeline + ResponseCompressionMiddleware
โ โโโ Authentication/ # JWT, API Key, custom auth handlers
โ โโโ Authorization/ # [Authorize], [AllowAnonymous] attributes
โ โโโ DependencyInjection/ # ServiceCollection + ServiceProvider
โ โโโ Configuration/ # ServerOptions, TlsOptions
โโโ samples/
โ โโโ EffinitiveFramework.Sample/ # Sample API project
โ โโโ Program.cs # Application entry point
โ โโโ Endpoints/ # Example endpoints
โโโ benchmarks/
โ โโโ EffinitiveFramework.Benchmarks/ # Performance benchmarks (BenchmarkDotNet)
โโโ tests/
โโโ EffinitiveFramework.Tests/ # Unit tests
๐ง Development
Prerequisites
- .NET 8 SDK or later (.NET 10 SDK for HTTP/3 support)
- Visual Studio 2022 / VS Code / Rider
Build
dotnet build
Run Tests
dotnet test
Run Sample
dotnet run --project samples/EffinitiveFramework.Sample
๐จ Design Principles
- Performance First - Every feature is evaluated for its performance impact
- Zero Allocations - Hot paths should allocate as little as possible
- Simple API - Easy to use, hard to misuse
- Type Safety - Leverage C# type system for compile-time guarantees
- Minimal Dependencies - Only depend on ASP.NET Core fundamentals
๐ฌ Performance Techniques Used
- Span<T> and Memory<T> - For zero-copy string operations
- ArrayPool<T> - For temporary buffer allocations
- ValueTask<T> - For reduced async allocations
- Aggressive Inlining -
[MethodImpl(MethodImplOptions.AggressiveInlining)] - Struct Types - Value types for small, frequently-used data
- Unsafe Code - Low-level optimizations where beneficial
๐ What's New in v2.7.0
| Change | Details |
|---|---|
| Rate limiting counted every client as one | HttpRequest.RemoteIpAddress was null on every HTTP/1.1 request, so the limiter's partition key was "unknown" for all callers and one noisy client could exhaust everyone's allowance. X-Forwarded-For never applied either. Present since 2.5.0. |
| 304 and HEAD no longer send content | Both paths cleared only one of the four ways a response can hold content, so an endpoint returning an object had it sent anyway. Since neither response carries a length, the peer read that content as the start of the next one and the connection desynchronised. |
| HTTP/3 field names | The QPACK decoder began reading one byte late, corrupting any header name outside the static table and every field after it. The codec now has tests. |
| Requests are reused per connection | Behaviour change. A connection parses all of its requests into one HttpRequest, as it already did for responses. A reference kept past the end of a handler will be seen to change. Copy what you need rather than passing the request into background work. |
| HTTP/2 advertises less per peer | SETTINGS_MAX_CONCURRENT_STREAMS 256 โ 100 and SETTINGS_INITIAL_WINDOW_SIZE 1 MB โ 96 KB, matching Kestrel. One peer's exposure drops from 256 MB per connection to under 32 MB. |
| Less work per request | HTTP/1.1 allocates about a third less, 1,452 โ 1,030 bytes end to end. HTTP/3 throughput is about 1.6x higher, 158,621 โ 253,800 req/s on sixteen pinned cores. |
See CHANGELOG.md.
๐ What's New in v2.6.0
| Feature | Details |
|---|---|
| Multiple listeners | AddListener() adds a socket beyond UsePort() and UseHttpsPort(), each with its own certificate and its own ALPN list. One server can offer HTTP/2 and HTTP/1.1 on one port while offering HTTP/1.1 alone on another. |
| ALPN belongs to the listener | Per RFC 7301 ยง3.2 the server selects from what the client advertised, and its own preference governs, so the list is what decides the protocol a port actually serves. |
| Cleartext HTTP/2 | UseHttp2Cleartext serves h2c with prior knowledge (RFC 9113 ยง3.3). The connection preface is validated as on the TLS path, so a client speaking HTTP/1.1 on such a port is rejected rather than served over the wrong protocol. |
| Certificate rotation | TlsOptions.ReloadOnChange resolves the certificate per handshake, so a renewal on disk takes effect without a restart. Established connections keep the certificate they negotiated with. |
close_notify on close |
TLS connections send the alert before closing the write side (RFC 8446 ยง6.1), so a client can tell a complete response from a truncated one. |
Fixes: a header line whose CRLF was split across two TCP reads is now carried
rather than rejected with 400, and a WebSocket reply is no longer held back by
a partly-arrived following frame. See CHANGELOG.md.
๐ What's New in v2.5.0
| Feature | Details |
|---|---|
| Rate limiting | UseRateLimiting() โ token-bucket allowance per client IP, returning 429 with Retry-After. Works across HTTP/1.1, HTTP/2 and HTTP/3. |
| Applied before routing | Static files, the OpenAPI document, and floods at nonexistent paths are all covered. |
| Per-endpoint overrides | [RateLimit(PermitLimit = 5, WindowSeconds = 60)] tightens one endpoint; [DisableRateLimit] exempts health checks entirely. |
| Reverse-proxy aware | AddTrustedProxy() opts into X-Forwarded-For; without it the header is ignored, since a client-supplied header would otherwise bypass the limit. |
| Bounded memory | MaxTrackedClients caps tracked allowances, so rotating source addresses cannot exhaust memory. |
See docs/RateLimiting.md.
๐ What's New in v2.4.0
| Feature | Details |
|---|---|
| OpenAPI document | UseOpenApi() serves an OpenAPI 3.0.3 spec at /openapi/v1.json, generated once at startup from the route table. |
| Swagger UI | Rendered at /swagger, with a configurable asset base URL for self-hosted or air-gapped use. |
| Zero-config description | Routes, path parameter types, request bodies, response schemas, and content types are all inferred from metadata the builder already resolved. |
| Documentation attributes | [OpenApiOperation], [OpenApiResponse], [OpenApiParameter], and [OpenApiIgnore] for what can't be inferred. |
| Schemas from your types | Naming follows the server's JsonSerializerOptions; DataAnnotations become schema constraints; $ref components with cycle safety. |
See docs/OpenApi.md.
๐ What's New in v2.3.0
| Feature | Details |
|---|---|
| Response caching | UseResponseCaching() + [ResponseCache(Duration = 30)] โ repeat GET/HEAD requests are served from a bounded in-process store without running the endpoint. |
| Cache headers | Cache-Control (public/private, max-age), Vary for declared headers and query keys, and Age on a hit. |
| Invalidation | TTL, plus automatic eviction of a path when a successful POST/PUT/PATCH/DELETE targets it (RFC 9111 ยง4.4). |
| Revalidation | Cached entries carry a strong ETag, so If-None-Match returns 304 โ on HTTP/1.1, HTTP/2 and HTTP/3. |
๐ What's New in v2.0.0
| Feature | Details |
|---|---|
| WebSocket | RFC 6455 โ MapWebSocket() or WebSocketEndpointBase. Fragmentation, ping/pong, close handshake. |
| HTTP/3 / QUIC | RFC 9114 + QPACK (RFC 9204). Auto-starts on .NET 10 alongside HTTPS. |
| Static files | Pre-loads wwwroot into FrozenDictionary at startup โ zero per-request I/O. |
| Gzip compression | UseResponseCompression() โ single-pass serialize+compress via pooled buffers. |
| Transport layer | IOQueue/SocketSenderPool matching Kestrel's architecture for maximum throughput. |
| Dual-target package | Ships net8.0 + net10.0 targets in a single NuGet package. |
See RELEASE_NOTES_v2.0.0.md for the full release notes and CHANGELOG.md for the complete version history.
๐ Comparison with FastEndpoints
| Feature | EffinitiveFramework | FastEndpoints |
|---|---|---|
| Routing Engine | Custom zero-allocation | ASP.NET Core |
| Endpoint Definition | Class-based | Class-based |
| Request Binding | JSON deserialization | Multiple strategies |
| Performance Focus | Maximum | High |
| Dependencies | Minimal | More features |
๐ง Roadmap
-
Route parameter extraction (e.g.,โ IMPLEMENTED/users/{id}) -
Query string bindingโ IMPLEMENTED (API Key auth) -
Header/cookie bindingโ IMPLEMENTED (Auth handlers) -
Request validationโ IMPLEMENTED (Routya.ResultKit integration) -
Middleware pipelineโ IMPLEMENTED (High-performance pipeline) -
Dependency injection integrationโ IMPLEMENTED (Full DI support) -
Server-Sent Events (SSE)โ IMPLEMENTED v1.1.0 (Real-time streaming) -
Response compression (gzip)โ IMPLEMENTED v2.0.0 (Single-pass serialize+compress) -
WebSocket supportโ IMPLEMENTED v2.0.0 (RFC 6455, full framing) -
Static file servingโ IMPLEMENTED v2.0.0 (Zero per-request I/O) -
HTTP/3 / QUIC protocolโ IMPLEMENTED v2.0.0 (Experimental, .NET 10+) -
Response cachingโ IMPLEMENTED v2.3.0 (Opt-in in-memory store + client cache headers) -
OpenAPI/Swagger integrationโ IMPLEMENTED v2.4.0 (OpenAPI 3.0.3 document + Swagger UI, generated at startup) -
Rate limitingโ IMPLEMENTED v2.5.0 (Token bucket per client IP, with per-endpoint overrides)
๐ค Contributing
Contributions are welcome! Please ensure:
- All benchmarks pass with improved or comparable performance
- Code follows existing patterns
- Tests are included for new features
- Performance-critical code includes comments explaining optimizations
๐ License
MIT License - see LICENSE file for details
๐ Acknowledgments
- Inspired by FastEndpoints
- Performance techniques from GenHTTP
- Built on ASP.NET Core
Note: This is a performance-focused framework. Always benchmark your specific use case to ensure it meets your requirements.
| 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 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.ObjectPool (>= 10.0.0)
- Routya.ResultKit (>= 2.1.0)
- System.IdentityModel.Tokens.Jwt (>= 8.16.0)
-
net8.0
- Microsoft.Extensions.ObjectPool (>= 8.0.0)
- Routya.ResultKit (>= 2.1.0)
- System.IdentityModel.Tokens.Jwt (>= 8.16.0)
- System.IO.Pipelines (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on EffinitiveFramework.Core:
| Repository | Stars |
|---|---|
|
MDA2AV/HttpArena
The most complete HTTP open source benchmarking platform. Don't just say you're fast, prove it.
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 2.8.0 | 155 | 10/26/2026 | |
| 2.7.1 | 119 | 10/13/2026 | |
| 2.7.0 | 125 | 10/13/2026 | |
| 2.6.0 | 150 | 9/2/2026 | |
| 2.5.0 | 180 | 7/31/2026 | |
| 2.3.0 | 140 | 7/29/2026 | |
| 2.2.0 | 185 | 6/22/2026 | |
| 2.1.3 | 179 | 6/19/2026 | |
| 2.1.2 | 578 | 6/19/2026 | |
| 2.1.1 | 176 | 6/9/2026 | |
| 2.1.0 | 194 | 6/2/2026 | |
| 2.0.0 | 228 | 5/19/2026 | |
| 1.3.1 | 217 | 4/9/2026 | |
| 1.3.0 | 140 | 4/9/2026 | |
| 1.2.0 | 477 | 1/21/2026 | |
| 1.1.0 | 701 | 12/1/2025 | |
| 1.0.0 | 251 | 11/27/2025 |
v2.7.0: Three correctness fixes, one of them security-relevant, and substantially less work per request.
Rate limiting counted every client against a single shared allowance. HttpRequest.RemoteIpAddress was null on every HTTP/1.1 request, plaintext and TLS alike, so the limiter's partition key fell through to "unknown" for every caller and one noisy client could exhaust the limit for all of them. X-Forwarded-For never applied either, because the trusted-proxy check is only consulted when the peer address is known. Present since rate limiting shipped in 2.5.0. The cause was ordering: the address was written onto the request before it was parsed, and the parser resets the request at the top of every attempt, because a request can arrive across any number of reads. The connection's facts are now applied after a successful parse. HttpRequest.IsHttps, which was always false on HTTP/1.1 including over TLS, had the same cause and is fixed with it.
304 and HEAD responses sent content. A response can hold its content four ways and both places that suppress it cleared only one, so an endpoint returning an object had it serialized and sent anyway. RFC 9110 15.4.5 forbids content on a 304 and 9.3.2 on a response to HEAD, but the framing was worse: neither carries a length, so the content that followed was read by the peer as the start of the next response and every exchange after it on that connection was misaligned.
HTTP/3 corrupted any header name outside the QPACK static table. The decoder began reading one byte late and took the length byte as the pattern, so the Huffman flag and the length were both wrong and every field after it was misaligned. A client sending an API key or correlation id over HTTP/3 had it silently mangled.
Behaviour change: a connection now parses all of its requests into one HttpRequest, as it already did for responses. A reference kept past the end of a handler will be seen to change, and then to be reused by the next request on that connection or by a different peer once the connection is pooled. Copy what is needed rather than passing the request into background work.
HTTP/2 advertises less to a single peer: SETTINGS_MAX_CONCURRENT_STREAMS drops from 256 to 100 and SETTINGS_INITIAL_WINDOW_SIZE from 1 MB to 96 KB, both matching Kestrel. Their product is what one peer can oblige the server to buffer, per connection, so this moves the exposure from 256 MB to under 32 MB.
Also on HTTP/3: a request now reports its version as HTTP/3 rather than HTTP/2, which both protocols previously claimed because they share one conversion; the response field section is encoded straight from the response rather than through a list and a string per value; and the end-of-stream flag is sent with the response rather than in a second call to the transport. The last two changed allocation but not throughput, which is worth saying rather than implying otherwise.
Performance: HTTP/1.1 allocates about a third less per request, 1,452 bytes down to 1,030 end to end, by matching methods, versions and known field names against constants the server already holds, building the entity tag in one allocation rather than four, and building the route table's span-keyed lookups once rather than per request. HTTP/3 throughput is 2.9x what it was, 158,621 to 455,556 req/s on sixteen pinned cores, which puts it ahead of Kestrel's own entry at 323,335 on the same host. Two causes: every request made three to five separate reads before it was parsed, because a variable-length integer needs its first byte before its length is known, and every read and write was handed the server's shutdown token, so thousands of concurrent streams contended on one registration lock twice per operation. Frames now come through a buffer, and per-stream operations take no token, which is also what Kestrel does.
v2.6.0: Multiple listeners, cleartext HTTP/2, and certificate rotation without a restart. AddListener() adds a socket beyond UsePort() and UseHttpsPort(), each with its own certificate and its own ALPN list, so one server can advertise HTTP/2 and HTTP/1.1 on one port while advertising HTTP/1.1 alone on another. Per RFC 7301 3.2 the server selects from what the client advertised and its own preference governs, so that list decides what a listener serves. UseHttp2Cleartext serves HTTP/2 with prior knowledge (RFC 9113 3.3), validating the 3.4 connection preface as the TLS path does, so a client speaking HTTP/1.1 on such a port is rejected rather than quietly served. TlsOptions.ReloadOnChange resolves the certificate per handshake through ServerCertificateSelectionCallback, so a renewal on disk takes effect on the next handshake while established connections keep the certificate they negotiated with; the files are polled rather than watched, because renewal tools rename a new pair over the old one and inotify reports that unreliably across container filesystems. Fixes: a header line whose CRLF was split across two TCP reads was answered 400 rather than carried, though RFC 9110 15.5.1 reserves 400 for a client error and where a read ended is not one; a WebSocket reply was held back by a partly-arrived following frame, because the write-batching test asked whether bytes remained rather than whether a whole frame had, and RFC 6455 5.2 frames carry an explicit length; and TLS connections now send a close_notify alert before closing, which RFC 8446 6.1 requires and SslStream.DisposeAsync does not do, without which a truncated response is indistinguishable from a complete one. The alert is sent before the request pipes are completed, because on the HTTP/1.1 path those are created over the SslStream with leaveOpen false and completing either disposes it, and it is bounded by a timeout because ShutdownAsync accepts no CancellationToken.
v2.5.0: Rate limiting. UseRateLimiting() applies a token-bucket allowance per client IP across HTTP/1.1, HTTP/2 and HTTP/3, returning 429 Too Many Requests with Retry-After and a ProblemDetails body. Applied before routing, so static files, the OpenAPI document, and floods at nonexistent paths are covered. [RateLimit(PermitLimit, WindowSeconds)] gives an endpoint its own tighter allowance and [DisableRateLimit] exempts one entirely. X-Forwarded-For is honored only from configured trusted proxies, walking the chain right-to-left. Tracked clients are capped so rotating source addresses cannot exhaust memory. Also adds HttpRequest.RemoteIpAddress and 429 to the cached status lines.
v2.4.0: OpenAPI/Swagger integration. UseOpenApi() serves an OpenAPI 3.0.3 document at /openapi/v1.json and Swagger UI at /swagger, generated once at startup from the route table and served from a pre-built buffer, so there is no per-request cost. Routes, path parameter types, request bodies, response schemas, and content types are inferred from existing metadata; [OpenApiOperation], [OpenApiResponse], [OpenApiParameter], and [OpenApiIgnore] add what cannot be. Schema property names follow the server's JsonSerializerOptions and DataAnnotations become schema constraints. Security schemes match the built-in JWT and API-key handlers. Also adds Router.GetRegisteredRoutes() and EndpointInvoker.ResponseType.
v2.3.0: Response caching. UseResponseCaching() serves repeat GET/HEAD requests from a bounded in-process store, skipping endpoint execution and JSON serialization, and emits Cache-Control/Vary/Age for client and proxy caches. Opt-in per endpoint via [ResponseCache(Duration, Location, VaryByHeader, VaryByQueryKeys)]. Entries expire on their duration and are evicted when a successful POST/PUT/PATCH/DELETE hits the same path. Cache hits answer If-None-Match with 304 on HTTP/1.1, HTTP/2 and HTTP/3. Requests carrying Authorization bypass the shared cache unless the endpoint opts in. Also fixes HTTP/2 outbound flow control: the send path now honors the peer's stream- and connection-level send windows (RFC 7540 6.9) instead of queueing whole bodies at once, and the connection send window starts at the RFC default of 65535 with the client's SETTINGS_INITIAL_WINDOW_SIZE tracked separately.