清除頁面的方法:使用“header("last-modified:".gmdate("d,d m y h:i:s" )."gmt");header("cache-control:no-cache,must-revalidate");”即可。
推薦:《php視頻教程》
在開發(fā)過程中我們常常會(huì)遇到頁面緩存的問題(特別是html的緩存);刷新后還是舊版的數(shù),再刷新下還是舊版數(shù)據(jù),慢慢的開始懷疑人生了,哈哈;所以在開發(fā)過程中我們又必要每次及時(shí)清除緩存。
加入幾行代碼就可搞定這個(gè)問題,控制瀏覽器緩存
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");