Cache缓存
来源:互联网 发布:现代诗歌 知乎 编辑:程序博客网 时间:2024/05/17 02:19
int cacheOutTime = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["CacheOutTime"]);
List<Student> listModel = new List<Student>();
Cache cache = HttpRuntime.Cache;
string cacheItemMo = "Community";
if (cache[cacheItemMo] == null )
{
listModel = GetList();
cache.Insert(cacheItemMo, listModel, null, DateTime.Now.AddSeconds(cacheOutTime), Cache.NoSlidingExpiration);
}
else
{
listModel = cache[cacheItemMo] as List<Student>;
if (listModel == null )
{
listModel = GetList();
cache.Insert(cacheItemMo, listModel, null, DateTime.Now.AddSeconds(cacheOutTime), Cache.NoSlidingExpiration);
}
}
List<Student> listModel = new List<Student>();
Cache cache = HttpRuntime.Cache;
string cacheItemMo = "Community";
if (cache[cacheItemMo] == null )
{
listModel = GetList();
cache.Insert(cacheItemMo, listModel, null, DateTime.Now.AddSeconds(cacheOutTime), Cache.NoSlidingExpiration);
}
else
{
listModel = cache[cacheItemMo] as List<Student>;
if (listModel == null )
{
listModel = GetList();
cache.Insert(cacheItemMo, listModel, null, DateTime.Now.AddSeconds(cacheOutTime), Cache.NoSlidingExpiration);
}
}
0 0
- 缓存cache
- 缓存 Cache
- 缓存 Cache
- 缓存--cache
- Cache缓存
- Cache缓存
- Cache缓存
- Session缓存和Cache缓存
- Session缓存和Cache缓存
- cache 强缓存 协商缓存
- Cache缓存使用相关
- 缓存的使用Cache
- 缓存Cache操作类
- Web Cache缓存
- 缓存 Data Cache
- 缓存 Output Cache
- ASP.NET--CACHE缓存
- Cache缓存的概念
- java程序的运行过程
- ffmpeg 学习资料
- JVM系列1:java内存区域分配
- 镜像反转二进制表达式,并输出十进制值
- android的编译和运行过程深入分析
- Cache缓存
- HTML5/CSS3学习笔记
- 对称、非对称加密技术初探
- POJ 1836 Alignment (动态规划LIS)
- 各种有关时间的插件
- android虚拟机详解(5%原创)
- 英尺转换成米
- 程序的链接、装载和库——《程序员的自我修养》笔记
- Unity之android推送