在ASP.NET中清空浏览器客户端的缓存
2007-01-13 10:37
351 查看
///
/// 清空浏览器客户端的缓存
///
public static void ClearClientPageCache()
{
HttpContext.Current.Response.Buffer=true;
HttpContext.Current.Response.Expires = 0;
HttpContext.Current.Response.ExpiresAbsolute=DateTime.Now.AddDays(-1);
HttpContext.Current.Response.AddHeader("pragma","no-cache");
HttpContext.Current.Response.AddHeader("cache-control","private");
HttpContext.Current.Response.CacheControl="no-cache";
}
/// 清空浏览器客户端的缓存
///
public static void ClearClientPageCache()
{
HttpContext.Current.Response.Buffer=true;
HttpContext.Current.Response.Expires = 0;
HttpContext.Current.Response.ExpiresAbsolute=DateTime.Now.AddDays(-1);
HttpContext.Current.Response.AddHeader("pragma","no-cache");
HttpContext.Current.Response.AddHeader("cache-control","private");
HttpContext.Current.Response.CacheControl="no-cache";
}
相关文章推荐
- 在ASP.NET中清空浏览器客户端的缓存
- 在ASP.NET中清空浏览器客户端的缓存
- 在ASP.NET中清空浏览器客户端的缓存
- 在ASP.NET中清空浏览器客户端的缓存
- 在ASP.NET中清空浏览器客户端的缓存
- asp.net 客户端浏览器缓存的Http头介绍
- asp.net 客户端浏览器缓存的Http头介绍
- 深入理解 ASP.NET 与客户端缓存 (Part 2 - ASP.NET 支持)
- ASP.NET性能优化之让浏览器缓存动态网页
- 对于长时间装载的ASP.NET页面如何在客户端浏览器中显示进度?
- 一起谈.NET技术,浅析ASP.NET清空缓存时遇到的问题
- ASP.NET 客户端静态文件请求设置缓存(Client Cache)
- ASP.net里不让浏览器缓存代码和Session使用注意事项
- Asp.Net浏览器缓存、信息安全问题
- asp.net获取客户端浏览器及主机信息
- ASP.NET获取客户端的操作系统、浏览器、.NET版本等信息
- ASP.NET获取客户端的操作系统、浏览器、.NET版本等信息(图)
- asp.net mvc浏览器缓存和压缩的实现
- ASP.NET性能优化之让浏览器缓存动态网页
- ASP.NET清空缓存时遇到的问题简析