直接上代码
web.config 片段 <caching>
      <outputCacheSettings>
        <outputCacheProfiles>
          <add name="CacheFiveMinute"  duration="300" varyByParam="none" location="Client" noStore="true" />
        </outputCacheProfiles> 
      </outputCacheSettings>
    </caching>
程序Action代码 片段         [OutputCache(CacheProfile = "CacheFiveMinute")]
        public ActionResult Index()
        {
  return View();
        }.chtml  页面输出 代码 片段
@DateTime.Now问题描述:
这样设置完毕后. 刷新页面或点击其他链接到这个页面. 时间都会变, 不会缓存.如果设置成服务器缓存, 缓存会成功.求解.