zoukankan      html  css  js  c++  java
  • 页面缓存 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>

  • 相关阅读:
    简述拦截器的工作原理?
    线程安全与非线程安全集合说一下,底层怎么实现的(hashmap,concurrenthashmap)
    表与表之间的关联关系
    手写9x9乘法表,冒泡排序
    主键和外键的区别
    为什么要使用连接池?
    AXI协议中的模棱两可的含义的解释(Cachable和Bufferable)
    ahb时序解析
    amba web
    Register Abstraction(9)
  • 原文地址:https://www.cnblogs.com/Yellowshorts/p/2915893.html
Copyright © 2011-2022 走看看