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>

  • 相关阅读:
    蓝桥杯基础练习 杨辉三角形
    蓝桥杯基础练习 回文数 特殊的数字
    普及图论三题 P1807 P1113 P 4017
    P3916 图的遍历
    [转载][总结]图论入门:建图,DFS,BFS,拓扑排序
    如何转载博客园的文章
    P1892 [BOI2003]团伙
    P1621 集合
    [模板]线性筛素数(欧拉筛)
    P5076 普通二叉树(简化版)
  • 原文地址:https://www.cnblogs.com/Yellowshorts/p/2915893.html
Copyright © 2011-2022 走看看