在web.config设置asp.net 页面缓存

<system.web>
    <caching>
      <outputCacheSettings>
        <outputCacheProfiles>
          <add name="pageCache" duration="60" varyByParam="none" enabled ="true"/>
        </outputCacheProfiles>
      </outputCacheSettings>
    </caching>
</system.web>
上面的意思为过期时间为60秒,不根据页面参数缓存。
页面中调用此设置如下。
<%@ OutputCache CacheProfile="pageCache" %>
暂时没找到更简单的设置方法

posted @ 2010-06-01 09:06  Sue_娜  阅读(713)  评论(0编辑  收藏  举报