httpmodules 和 httphandlers 之间的交互

发布于 2024-07-13 18:35:53 字数 331 浏览 9 评论 0原文

在我们的 asp.net 2.0 应用程序中,我们使用 httpmodule 和 httphandler 通过 cookie 计算一些指标。 为了计算网络传输时间,httpmodule:EndRequest 将 Transferstart 存储在 cookie 中,而 httphandler:Processrequest 使用 datetime.now 减去 Transferstart 来确定总体网络时间。 它是否正确? 我也不清楚请求流程。 它是不是像这样: 请求> HttpModule::OnStart > HttpModule::OnEnd > HttpHandler::ProcessRequest?

In our asp.net 2.0 app we are using httpmodule and httphandler to calculate some metrics via cookies. To calculate network transfer time, httpmodule:EndRequest stores Transferstart in the cookie and httphandler:Processrequest uses datetime.now to subtract the transferstart to determine overall network time. Is this correct? I am also unclear about the request flow process. Does it go something like this:
request > HttpModule::OnStart > HttpModule::OnEnd > HttpHandler::ProcessRequest?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情魔剑神 2024-07-20 18:35:53

顺序是:

  • Module OnStart
  • Handler ProcessRequest
  • Module OnEnd

顺便说一句,最好使用 HttpContext.Items 属性在处理程序和模块之间共享信息,而不是使用 cookie。

The order is:

  • Module OnStart
  • Handler ProcessRequest
  • Module OnEnd

By the way, it's probably better to use HttpContext.Items property to share info between a handler and a module instead of a cookie.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文