下面的示例将某一页在服务器上仅缓存一分钟,并且根据浏览器类型和主版本存储该页的不同版本。
<outputCacheSettings>
<outputCacheProfiles>
<add name="ServerOnly"
duration="60"
varyByCustom="browser"
location="Server" />
</outputCacheProfiles>
</outputCacheSettings>设计需要以这种方式缓存的页时,您需要向该页添加以下指令:
<%@ OutputCache CacheProfile="ServerOnly" %>
有关更多信息,请参见 @ OutputCache。