erlchina 发表于 2017-4-13 09:46:11

Html+Asp+Php+Jsp:4种语言禁止浏览器缓存页面的方法

Html+Asp+Php+Jsp:4种语言禁止浏览器缓存页面的方法

HTTP:
<META HTTP-EQUIV=&quot;pragma&quot; CONTENT=&quot;no-cache&quot;>
<META HTTP-EQUIV=&quot;Cache-Control&quot; CONTENT=&quot;no-cache, must-revalidate&quot;>
<META HTTP-EQUIV=&quot;expires&quot; CONTENT=&quot;Wed, 26 Feb 1997 08:21:57 GMT&quot;>
<META HTTP-EQUIV=&quot;expires&quot; CONTENT=&quot;0&quot;>

ASP
response.expires=0
response.addHeader(&quot;pragma&quot;,&quot;no-cache&quot;)
response.addHeader(&quot;Cache-Control&quot;,&quot;no-cache, must-revalidate&quot;)

PHP
header(&quot;Expires: Mon, 26 Jul 1997 05:00:00 GMT&quot;);
header(&quot;Cache-Control: no-cache, must-revalidate&quot;);
header(&quot;Pragma: no-cache&quot;);

JSP:
response.addHeader(&quot;Cache-Control&quot;, &quot;no-cache&quot;);
response.addHeader(&quot;Expires&quot;, &quot;Thu, 01 Jan 1970 00:00:01 GMT&quot;);
页: [1]
查看完整版本: Html+Asp+Php+Jsp:4种语言禁止浏览器缓存页面的方法