您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php如何清除页面缓存?

2025/11/5 16:46:26发布12次查看
清除页面的方法:使用“header(last-modified:.gmdate(d,d m y h:i:s ).gmt);header(cache-control:no-cache,must-revalidate);”即可。
推荐:《php视频教程》
在开发过程中我们常常会遇到页面缓存的问题(特别是html的缓存);刷新后还是旧版的数,再刷新下还是旧版数据,慢慢的开始怀疑人生了,哈哈;所以在开发过程中我们又必要每次及时清除缓存。
加入几行代码就可搞定这个问题,控制浏览器缓存
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");
方法2:
header("cache-control: no-cache, must-revalidate");header("expires: mon, 26 jul 1997 05:00:00 gmt");header("content-type: application/xml; charset=utf-8");
以上就是php如何清除页面缓存?的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product