Repository navigation
Don't cache aborted responses in ResponseCaching - #69949
Merged
Merged
Conversation
Co-authored-by: Youssef1313 <[email protected]>
Youssef1313
marked this pull request as ready for review
October 20, 2026 15:58
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Required frozen review evidence was unavailable, leaving approval validation incomplete and requiring human review.
No open issues 🎉
What changed in this PR
Extends the aborted-response safeguard from OutputCaching to ResponseCaching, preventing canceled requests from populating the response cache.
Changes:
- Checks request cancellation before caching the response body.
- Adds tests for skipped cache storage and subsequent requests receiving fresh responses.
| File | Description |
|---|---|
| src/Middleware/ResponseCaching/test/ResponseCachingMiddlewareTests.cs | Adds aborted-response regression tests. |
| src/Middleware/ResponseCaching/src/ResponseCachingMiddleware.cs | Prevents caching when the request is canceled. |
Review effort: Balanced
DeagleGross
approved these changes
Oct 20, 2026
Youssef1313
approved these changes
Oct 20, 2026
wtgodbe
approved these changes
Oct 20, 2026
Youssef1313
temporarily deployed
to
copilot-pat-pool
October 20, 2026 21:05 — with
GitHub Actions
Inactive
Youssef1313
temporarily deployed
to
copilot-pat-pool
October 20, 2026 21:05 — with
GitHub Actions
Inactive
Youssef1313
temporarily deployed
to
copilot-pat-pool
October 20, 2026 21:06 — with
GitHub Actions
Inactive
Youssef1313
temporarily deployed
to
copilot-pat-pool
October 20, 2026 21:08 — with
GitHub Actions
Inactive
Youssef1313
temporarily deployed
to
copilot-pat-pool
October 20, 2026 21:08 — with
GitHub Actions
Inactive
Youssef1313
temporarily deployed
to
copilot-pat-pool
October 20, 2026 21:09 — with
GitHub Actions
Inactive
Contributor
|
✅ No documentation PR was created. Confidence that documentation is needed: 10% No docs needed: internal bug fix that stops ResponseCaching from caching aborted responses, matching an earlier OutputCaching fix. Documentation surfaces considered
|
Youssef1313
temporarily deployed
to
copilot-pat-pool
October 20, 2026 21:09 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
This implements the same fix as #68683, but for ResponseCaching here. The old PR only handled OutputCaching. See details from the other PR.