码迷,mamicode.com
首页 > 系统相关 > 详细

使用Cache缓存

时间:2015-02-07 15:43:03      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:

 

存放位置:服务器内存,用于频繁访问且不轻易更改的内容缓存。

  

string CacheKey = "CT1"; //检索指定项,
object objModel = Cache.Get(CacheKey);
if (objModel == null)
{
objModel = "插入值";
Cache.Insert(CacheKey, objModel, null, DateTime.Now.AddMinutes(120), System.Web.Caching.Cache.NoSlidingExpiration);
} //缓存120分钟

  

使用Cache缓存

标签:

原文地址:http://www.cnblogs.com/LoveTX/p/4278813.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!