outputcaching以及 回调缓存
来源:互联网 发布:java与或非符号 编辑:程序博客网 时间:2024/06/04 00:32
1.通过时间来控制缓存(一旦时间到了,无论数据库的数据是否改变,都会释放缓存)
<%@ outputcache Druation="60" VaryByParam="none"%>
将页面缓存为60秒 60秒内刷新内容不变 提高访问效率
由参数改变缓存内容:
<%@ outputcache Druation="60" VaryByParam="state"%>
VaryByParam="state"
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:pubsConnectionString2 %>"
SelectCommand="SELECT au_id, au_lname, au_fname, phone, address, city, state, zip, contract FROM authors where state=@state">
<SelectParameters>
<asp:QueryStringParameter DefaultValue="CA" Name="state" QueryStringField="state" />
</SelectParameters>
</asp:SqlDataSource>
同过指定不同的state来缓存state内容
<%@ outputcache Druation="60" VaryByParam="state"%>
<asp:QueryStringParameter DefaultValue="CA" Name="state" QueryStringField="state" />
联系起来
回调缓存:
<script runat="server">
Shared Function GetCurrentDate(ByVal context As HttpContext) As String
Return Now.ToString()
End Function
</script>
Real Time:
<asp:Substitution ID="Substitution1" runat="server" MethodName="GetCurrentDate" />
也可以把一个web用户控件 设置为 缓存,然后把用户控件添加到别的页面中
这样这个页面的本身 并没有设置缓存 但是其中的控件却是缓存起来了 这样可以达到同样的效果
2.通过数据库(通过配置数据库连接池,只有当数据库中数据改变的时候,缓存才会改变)
- outputcaching以及 回调缓存
- 缓存Memcached以及缓存策略
- 缓存Memcached以及缓存策略
- 缓存Memcached以及缓存策略
- 缓存Memcached以及缓存策略
- 缓存以及定位
- 数据缓存以及存取
- JSP 页面缓存以及清除缓存
- JSP 页面缓存以及清除缓存
- JSP 页面缓存以及清除缓存
- SDWebImage 缓存策略以及缓存清理
- JSP 页面缓存以及清除缓存
- 获取缓存的大小 以及清理缓存
- iOS 计算缓存大小以及清理缓存
- JSP 页面缓存以及清除缓存 (转载)
- Glide获取缓存大小以及清除缓存
- 自定义缓存策略,以及删除缓存
- iOS 缓存,以及缓存大小,缓存清理等
- HDU 1969(搜索题,二分)
- vmware下安装gcc
- openSUSE 11.3 Apache httpd.conf 文件配置
- 济南好吃的,我要吃遍
- Poj 1157(动态规划)
- outputcaching以及 回调缓存
- 关于开始程序的快捷方式不显示问题
- 串口DCB参数含义
- 关于nand flash的地址 A8,寻址,忽略。
- C++内存调试技术
- 独立宣言
- gridview的编辑状态下样式不受控制的问题
- 实习小结2010-07-25
- 设计模式之 memento与observer