cache缓存(未完成)
2016-11-30 17:30
204 查看
缓存html页面(后台代码就不走了)
Duration="5"(缓存过期时间,单位:s)
VaryByParam="*"(传递的是Url参数,防止缓存霍乱,可以为id,none,a)
缓存依赖项,直接上Demo
Duration="5"(缓存过期时间,单位:s)
VaryByParam="*"(传递的是Url参数,防止缓存霍乱,可以为id,none,a)
<%@ OutputCache Duration="5" VaryByParam="*" %>
缓存依赖项,直接上Demo
protected void Page_Load(object sender, EventArgs e) { string fielPath = Request.MapPath("File.txt"); if (Cache["fileContent"]==null) { //文件缓存依赖 CacheDependency cDep=new CacheDependency(fielPath); string fileContent = File.ReadAllText(fielPath); Cache.Insert("fileContent", fileContent, cDep); Response.Write("数据来自文件"); } else { Response.Write("数据来自缓存" + Cache["fileContent"].ToString()); } }
相关文章推荐
- sqlCacheDependency 更新缓存Cache
- 使用Nginx的proxy_cache缓存功能取代Squid
- django cache 缓存系统
- ASP.NET2.0 缓存(Cache)技术介绍
- WordPress优化之利用Nginx fastcgi_cache缓存加速
- 利用 Cache_Lite代替codeigniter中的cache功能, --- ci 缓存扩展
- jQuery源码分析-07数据缓存-Cache
- Simple server side cache for Express with Node.js——Express 实现简单的服务器端缓存【翻译】
- PHP常见缓存技术分析(cache)
- Cache-control(网页缓存)
- 使用Nginx的proxy_cache缓存功能取代Squid
- jQuery缓存操作-cache数据
- 使用Nginx的proxy_cache缓存功能取代Squid(转)
- nginx反向代理tomcat集群达到负载均衡,同时使用proxy_cache做web缓存 推荐
- 【Android开源项目分析】android轻量级开源缓存框架——ASimpleCache(ACache)源码分析
- 一个小工具,用来自动清除Outlook 的地址自动完成缓存 (Outlook e-mail address auto complete cache)
- 设置不使用缓存的过滤器(ClearCacheFilter)
- 缓存Cache操作类
- Nginx反向代理和proxy_cache缓存搭建CDN服务器加快Web访问速度
- 实现Android 获取cache缓存的目录路径的方法