-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.Perfarea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresdesign-proposalThis issue represents a design proposal for a different issue, linked in the descriptionThis issue represents a design proposal for a different issue, linked in the description
Milestone
Description
Summary
RedirectRule.ApplyRule
is comparing the request path withPathString.Empty
, which ends up being a string comparison.RedirectRule.ApplyRule
is boxing aPathString
(1)(2).
Motivation and goals
This is in a hot path for applications that use redirections.
Detailed design
- Use
path.HasValue
instead. - Use
pathBase.ToUriComponent()
instead.- A better option would be use
UriHelper.BuildRelative
. The current implementation doesn't encode the path; only the path base and the query string.
- A better option would be use
Metadata
Metadata
Assignees
Labels
Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.Perfarea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresdesign-proposalThis issue represents a design proposal for a different issue, linked in the descriptionThis issue represents a design proposal for a different issue, linked in the description