[PHP]如何不讓client browser cache網頁資料

有關網頁及相關語法的討論
回覆文章
頭像
tim
文章: 1384
註冊時間: 2008年 11月 26日, 00:49

[PHP]如何不讓client browser cache網頁資料

文章 tim »

參考資料,
http://faqts.com/knowledge_base/view.phtml/aid/14481

使用 header 的內容如下,

header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
/* Date in the past*/

header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
/* always modified*/

header("Cache-Control: no-cache, no-store, must-revalidate");
/* HTTP/1.1 */read
多多留言, 整理文章, 把經驗累積下來.....
回覆文章