• 页面缓存 OutputCache



    <%@ OutputCache Duration="15" VaryByParam="none" %> 使用页面输出缓存
    <%@ OutputCache Duration="3600" VaryByParam="id" %> 使用参数变化输出缓存
    <%@ OutputCache Duration="3600" VaryByControl="DropDownList1" %> 基于控件变化的输出缓存
    <%@ OutputCache Duration="3600" VaryByHeader="User-Agent" %>基于头变化的输出缓存
    <%@ OutputCache Duration="3600" VaryByParam="none" VaryByCustom="browser" %>基于浏览器变化的输出缓存
    <%@ OutputCache Duration="3600" VaryByParam="none" Location="Any"%>设置缓存的位置
    <%@ OutputCache Duration="3600" VaryByParam="none" %> 创建页面输出缓存的文件依赖 当文件修改时 缓存页面自动失效 并重新在下次页面请求是生成 

         Response.AddFileDependency(MapPath("Movies.xml"));

    <%@ OutputCache Duration="3600" VaryByParam="none" %>使用编程的方式设置页面输出缓存过期 

        HttpResponse.RemoveOutputCacheItem(Page.ResolveUrl("~/xxxx.aspx"));

         Response.Redirect("~/xxxx.aspx");

    <%@ OutputCache Duration="3600"  CacheProfile="CachelHours"  %>创建页面输出缓存配置

    <system.web>
       <caching>
          <outputCacheSettings>
             <outputCacheProfiles>
                <add name="CacheHour" duration="3600" varyByParam="none"/>
             </outputCacheProfiles>
          </outputCacheSettings>
       </caching>
     </system.web>

  • 相关阅读:
    关于loose.dtd和xhtml1transitional.dtd等文档类型定义模型中CSS失效的解决办法。
    JSON扫盲帖+JSON类教程
    jQuery中Ajax事件
    JQuery绑定事件 时如何传递参数
    xml include 另外一个xml文件
    ubuntu 两张网卡时网络设置
    Letcode 题:pow(x,n)
    Java编程语言中sleep()和yield()的区别
    JProfiler与eclipse集成
    zz 字符串相关
  • 原文地址:https://www.cnblogs.com/Yellowshorts/p/2915893.html
Copyright © 2020-2023  润新知