摘要: /// <summary> /// 文件缓存 /// </summary> protected void SetFileCache() { //获取文件 string filePath = Request.MapPath("File.txt"); if(Cache["fileContent"]==n 阅读全文
posted @ 2018-10-15 20:49 Mr靳先生 阅读(633) 评论(0) 推荐(0)
摘要: <%@ OutputCache Duration="5" VaryByParam="*"%> 可以在aspx加上这句话, 则是将整个html页面缓存。 1.Duration 默认是秒 2.VaryByParam指参数 一个参数id,两个参数id;a 一般写*多个参数 参数名称必须和地址栏的参数一致 阅读全文
posted @ 2018-10-15 17:12 Mr靳先生 阅读(260) 评论(0) 推荐(0)
摘要: 1.Cache与Session的区别每个用户都有自己单独的Session对象但是放在Cache中的数据是大家共享的 protected void SetCache() { //判断缓存是否为空 if (Cache["UserInfo"] == null) { Bll.UserInfoBll user 阅读全文
posted @ 2018-10-15 17:07 Mr靳先生 阅读(865) 评论(0) 推荐(0)