3

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

4

1 回答 1

3

顺序是:

  • 模块启动
  • 处理程序处理请求
  • 模块 OnEnd

顺便说一句,使用HttpContext.Items属性在处理程序和模块之间共享信息可能比使用 cookie 更好。

于 2009-02-20T14:51:55.093 回答