读书人

关于网页缓存处理有关问题

发布时间: 2012-01-20 18:53:53 作者: rapoo

关于网页缓存处理问题
加了下面这部分代码,在大部分机器(包括XP系统)上访问时候均达到了禁止缓存的目的,但是在有一台机器上无效,为XP系统IE6,SP2
这怎么回事啊?
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Expires = -1;
HttpContext.Current.Response.ExpiresAbsolute = System.DateTime.Now.AddDays(-1);
HttpContext.Current.Response.AddHeader( "pragma ", "no-cache ");
HttpContext.Current.Response.AddHeader( "cache-control ", "no-cache, must-revalidate ");
HttpContext.Current.Response.CacheControl = "no-cache ";
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.Server);
HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(true);
HttpContext.Current.Response.Cache.SetExpires(DateTime.MinValue);

[解决办法]
会不会是补定的原因呢?

读书人网 >asp.net

热点推荐