REST服务的IHttpHandler与IHttpModule [英] IHttpHandler vs IHttpModule for REST Services

查看:64
本文介绍了REST服务的IHttpHandler与IHttpModule的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这两种方法中的哪一种更适合实现要在IIS-7上托管的高性能REST服务-IHttpHandlerIHttpModule?

我最感兴趣的是这两个量表中哪一个最好,即响应速度最快,使用的资源最少.

身份验证的需求会影响选择吗?

我在这里阅读了几篇关于两者之间差异的文章,但是在实现高性能的REST服务时,仍然很难看出使用其中一种会比另一种有什么好处.可能需要写一个来找出答案.

换句话说,如果我们需要实现一个REST服务来每秒处理1000个以上的光请求,那么以下哪种方法是最好的?


  • WCF
  • IHttpHandler
  • IHttpModule
  • Which of the two approaches is better suited for implementing a high-performing REST Service to be hosted on IIS-7 - IHttpHandler or IHttpModule?

    I''m mostly interested in which of the two scales best, i.e. fastest to respond, with the least of resources to use.

    Would the need for authentication have any impact on making the choice?

    I''ve read a few articles here about differences between the two, but it''s still difficult to see if use of one will offer any benefit over the other when implementing a high-performing REST service. It probably takes to write one to find out.

    To put it differently... if we need to implement a REST service to process more than 1000 light requests per second, which of the following approaches is the best one?


    • WCF
    • IHttpHandler
    • IHttpModule
    • 推荐答案

      这取决于您要实现的目标-您希望Handler \ Module做什么?

      直到最近,我们一直在使用MVC框架来提供RESTful服务-设置和升级非常简单保持,执行良好并拥有我们需要的一切.

      否则,您可能需要查看.Net 4.5中的新Web API.

      使用ASP.NET Web API创建REST服务 [ ^ ]

      另外,您可以看一下ServiceStack-我听说过很多不错的东西,但是还没有用过自己

      http://www.servicestack.net/ [ ^ ]
      It depends what you''re trying to achieve - what do you want the Handler \ Module to do?

      Up until recently, we''ve been using the MVC framework to provide RESTful services - it''s really simple to setup & maintain, performs well and has everything we need.

      Otherwise, you may want to look at the new Web API in .Net 4.5

      Creating a REST service using ASP.NET Web API[^]

      Alternatively, you can have a look at ServiceStack - I hear good things about this, but haven''t used myself

      http://www.servicestack.net/[^]


      这篇关于REST服务的IHttpHandler与IHttpModule的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆