ASP.NET MVC3 IIS7.5:Cache-Control maxage始终为0(不适合客户端缓存)

Ale*_*tin 3 asp.net-mvc caching asp.net-mvc-3

我正在用Fiddler测试我的网站,并注意到Web服务器总是返回

Cache-Control: private, s-maxage=0
Run Code Online (Sandbox Code Playgroud)

用于动态内容(MVC动作).这可以防止页面在客户端缓存.我想知道它是MVC还是IIS的问题.我该如何解决?我真的需要客户端缓存才能工作.

谢谢!

PS下面是完整的响应标头集:

HTTP/1.1 200 OK Cache-Control:private,s-maxage = 0 Content-Type:text/html; charset = utf-8 Content-Encoding:gzip Vary:Accept-Encoding Server:Microsoft-IIS/7.5 X-AspNetMvc-Version:3.0 X-AspNet-Version:4.0.30319 X-UA-Compatible:IE = edge,Chrome = 1日期:2011年11月20日星期日23:07:46 GMT内容长度:2050

tva*_*son 7

使用控制器和/或操作上的OutputCacheAttribute为该控制器的操作或特定操作设置缓存策略.

 [OutputCache( Location = OutputCacheLocation.Client, Duration = 600 )]
 public class HomeController : Controller
 {
    ..
 }
Run Code Online (Sandbox Code Playgroud)