Routing vs Url Rewrite (IIS7) Performance

强颜欢笑 提交于 2019-12-08 18:06:20

问题


I was wondering is there any difference in terms of performance between the two approaches? Any good articles on this?


回答1:


Lets think about the difference in what's actually happening:

URL rewriting:

  • IIS receives request and passes it to unmanaged module
  • Module matches the request against a set of patterns and returns a transformation
  • IIS passes the returned transformation to the ASP.NET module and starts request lifecycle

Routing:

  • IIS receives request and passes it to ASP.NET
  • ASP.NET matches the request against a set of patterns and determines an entry point for handling the request
  • ASP.NET begins request lifecycle on that handler

I'd say the two are so close you'd be hard-pressed to find a situation where the difference is noticeable.



来源:https://stackoverflow.com/questions/937600/routing-vs-url-rewrite-iis7-performance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!