Conversation
Co-authored-by: guardrex <1622880+guardrex@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update rate limiting middleware article for accurate Retry-After headers
Use Oct 2, 2026
MetadataName.RetryAfter in rate limiting OnRejected example and add .NET 11 note
guardrex
marked this pull request as ready for review
October 2, 2026 10:43
guardrex
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
OnRejectedexample in the rate limiting article hard-codesRetry-After: 60and doesn't mention that in .NET 11FixedWindowRateLimiterreports an accurateRetryAftermetadata value. This PR updates the example and adds a version-scoped note.OnRejectedexample (aspnetcore/performance/rate-limit.md)MetadataName.RetryAfterfromcontext.Lease. The header is set only when the limiter provides that metadata. This matches the pattern inrate-limit-samples.md.using System.Globalization;andusing System.Threading.RateLimiting;..NET 11 note
> [!NOTE]under:::moniker range=">= aspnetcore-11.0"says fixed-window rejections now report the next window boundary. It also says limiters that can't estimate availability, such asConcurrencyLimiter, provide no metadata.>= aspnetcore-7.0zone is closed and reopened around the note. The article now has three moniker openers and closers.Metadata:
ms.dateis updated.Review notes:
<xref:System.Threading.RateLimiting.*>UIDs (FixedWindowRateLimiter,ConcurrencyLimiter) are taken from the issue's proposed text. They haven't been checked against the API docs or the OpenPublishing build.MetadataName.RetryAfterpattern is valid on earlier versions, so the example is unscoped and only the note is .NET 11-only.Internal previews
Build report