如何在 IIS 6 ASP.NET MVC Web 应用程序中为静态内容启用过期标头?
我们正在运行一个 ASP.NET MVC 2.0 Web 应用程序,它在带有 IIS 6.0 的 Windows Server 2003 上运行。据我所知,如果我们使用 IIS 7,那么实现客户端缓存会很容易。然而,这是我无法控制的。此外,更改 IIS 6 本身内的设置可能非常容易。然而,我又无法控制这一点。
我正在寻找的是一个可以在我的项目本身(也许是 web.config?)中实现的解决方案,它允许我为静态内容(JS、CSS、图像等)指定过期标头。
We are running a ASP.NET MVC 2.0 web app and it's running on Windows Server 2003 with IIS 6.0. I understand it would be easy to implement client caching if we used IIS 7. However, that is something I don't have control over. Also, it would probably be very easy to change settings within IIS 6 itself. However, again, I don't have control over that.
What I am looking for is a solution that I can implement within my project itself (web.config perhaps?) that allows me to specify expires headers for static content (JS, CSS, images, etc...).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅此文章,了解如何在站点范围内配置内容过期:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/0fc16fe7-be45-4033-a5aa-d7fda3c993ff.mspx?mfr=true
See this article for how to configure content expiration site-wide:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/0fc16fe7-be45-4033-a5aa-d7fda3c993ff.mspx?mfr=true