今日在开发设计时碰到1种方式,便是顾客规定网页页面不缓存文件,查了1下得出以下几种不让网页页面缓存文件的方法
html
要是加在头顶部便可以了.
拷贝编码
编码以下:<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
</HEAD>
asp实例教程做法
拷贝编码
编码以下:Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "No-Cache"
php实例教程做法
拷贝编码
编码以下:<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
?>
也有1种更简易的方式,便是大伙儿ajax时用到的?mt=随意数据信息