HttpModules和HttpHandlers之间的交互

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

3
顺序为:
  • 模块 OnStart
  • 处理程序 ProcessRequest
  • 模块 OnEnd
顺便提一下,最好使用 HttpContext.Items 属性在处理程序和模块之间共享信息,而不是使用 cookie。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接