-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
area-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresinvestigate
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When there's a racing condition on OutputCache, with "Locking" enabled, and the first request to hit the OutputCache middleware is cancelled by the client, the middleware resolves the second request to an empty response.
I suspect that the cancelled request ends up caching an empty response and that's the one served on the subsequent requests.
Note that it only happens with the locking feature enabled.
Expected Behavior
The OutputCache middleware should not cache the cancelled request, empty response, and the successful request should return content.
Steps To Reproduce
Minimal repo: https://github.com/FP3ixoto/OutputCacheIssue
Exceptions (if any)
No response
.NET Version
7.0.404; 8.0.100
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresinvestigate