프로그래밍/SQL & PHP
header no-cache
님투
2008. 12. 16. 15:46
반응형
-> 항상 새로운 페이지 열기 - 개쉬
캐쉬 사용 않기
게시판 등에서 새로운 글이 갱신되지 않을 경우나, 메인 페이지를 항상 새로운 페이지로 보여줘야 할 경우에 사용한다.
<?
header("Cache-Control:no-cache");
header("Pragma:no-cache");
?>
만약 위의 코드로 되지 않는다면,
<?
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-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>
또는 <meta> tag로,
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="wed, 04 jul 1973 16:00:00 gmt">
[출처 : php.net]
반응형