【发布时间】:2010-12-28 20:49:43
【问题描述】:
我在 II7 和 Windows 2008 Server 上运行 ASP.NET MVC 1.0 应用程序 (.NET 3.5)。 该应用程序以“集成管道”模式部署。
在 Global.asax.cs 我添加了:
public void Application_EndRequest(Object sender, EventArgs e) {
//print URL
}
即使是 /Content 和 /Scripts 文件夹中的静态内容(图像、css、js)也会调用该方法。 这是正确的吗?
MSDN (http://msdn.microsoft.com/en-us/library/bb470252.aspx) 说:
"The Execute handler stage, where the handler (a module scoped to a URL) is invoked to construct the response. For .aspx files, the PageHandlerFactory handler is used to respond to the request.
For static files, the native-code StaticFileModule module responds to the request. "
那么应该为静态内容调用 Application_EndRequest() 吗?
如何确保浏览器缓存静态内容?
谢谢。
【问题讨论】:
标签: asp.net-mvc iis-7