zoukankan      html  css  js  c++  java
  • Html、Asp、Php、Jsp禁止页面缓存

    html:
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache, must-revalidate">
    <meta http-equiv="expires" content="wed, 26 feb 1997 08:21:57 gmt">
    <meta http-equiv="expires" content="0">

    php:
    1.
    header("expires: mon, 26 jul 1997 05:00:00 gmt");
    header("cache-control: no-cache, must-revalidate");
    header("pragma: no-cache");
    2.
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");

    asp:
    1.
    response.expires=0
    response.addheader("pragma","no-cache")
    response.addheader("cache-control","no-cache, must-revalidate")
    2.
    Response.Expires = 0
    Response.Expiresabsolute = Now() - 1
    Response.AddHeader "pragma","no-cache"
    Response.AddHeader "cache-control","private"
    Response.CacheControl = "no-cache"

    jsp:
    response.addheader("cache-control", "no-cache");
    response.addheader("expires", "thu, 01 jan 1970 00:00:01 gmt");

  • 相关阅读:
    UVA10891
    UVA10453
    UVA 10201
    UVA10154
    UVA11137
    UVA10617
    UVA10271
    UVA10739
    UVA10306
    节流防抖
  • 原文地址:https://www.cnblogs.com/Athrun/p/3470590.html
Copyright © 2011-2022 走看看