防止网页后退--禁止缓存

protected void Page_Load(object sender, EventArgs e)
{
    //防止网页后退--禁止缓存
    Response.Expires = 0;
    Response.Buffer = true;
    Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
    Response.AddHeader("pragma", "no-cache");
    Response.CacheControl = "no-cache";
}

你可能感兴趣的:(缓存)