ASP中控制頁面過期

字號:


    可以直接用 HTML 的 META 來實現(xiàn)。
    放入 HTML 的 HEAD 部分
    <!--禁用緩存部分開始-->
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Progma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache,must-revalidate" />
    <!--禁用緩存部分結(jié)束-->
    ASP 代碼如下:
    放在頁面代碼的頭部
    Response.Expires = 0
    Response.ExpiresAbsolute = Now - 1
    Response.AddHeader "progma", "no-cache"
    Response.AddHeader "cache-control", "private"
    Response.CacheControl = "no-cache"