差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

次のリビジョン
前のリビジョン
study:php5:cache_control [2010/08/06 02:38] – created bananastudy:php5:cache_control [2010/08/06 02:55] (現在) banana
行 3: 行 3:
  
 ===== nocache control ===== ===== nocache control =====
-クライアント、プロキシにキャッシュさせないときのコードを次に示す。 +クライアント、プロキシにキャッシュを無効化するためのコードを次に示す。 
-<code>+<code php>
     header('Pragma: no-cache');     header('Pragma: no-cache');
     header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');     header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
行 10: 行 10:
     header('Last-Modified:');     header('Last-Modified:');
 </code> </code>
 +
 +===== private cache control =====
 +共有されないキャッシュを指定する場合のコードを次に示す。
 +<code php>
 +    $cache_expire = session_cache_expire() * 60;
 +    header('Pragma: no-cache');                       // anti-proxy
 +    header('Expires:');                               // anti-mozilla
 +    header("Cache-Control: private, max-age={$cache_expire}, pre-check={$cache_expire}");  // HTTP/1.1 client
 +    header('Last-Modified:');
 +</code>
 +
 +===== reference =====
 +  - [[http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9|HTTP/1.1: Header Field Definitions #14.9 Cache Control]]
  
  
  

QR Code
QR Code study:php5:cache_control (generated for current page)