蝶恋花

  博客园  ::  :: 新随笔  :: 联系 ::  :: 管理

    #region 清空客户端页面缓存

    /// <summary>

    /// 清空客户端页面缓存

    /// </summary>

    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";

    }

    #endregion

posted on 2011-01-05 13:09  _蝶恋花  阅读(911)  评论(0编辑  收藏  举报