1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"><head><!-- 4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 5 This file is generated from xml source: DO NOT EDIT 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 --> 8<title>mod_cache - Apache HTTP サーバ</title> 9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 11<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" /> 12<script src="/style/scripts/prettify.js" type="text/javascript"> 13</script> 14 15<link href="/images/favicon.ico" rel="shortcut icon" /></head> 16<body> 17<div id="page-header"> 18<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p> 19<p class="apache">Apache HTTP サーバ バージョン 2.2</p> 20<img alt="" src="/images/feather.gif" /></div> 21<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 22<div id="path"> 23<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP サーバ</a> > <a href="http://httpd.apache.org/docs/">ドキュメンテーション</a> > <a href="../">バージョン 2.2</a> > <a href="./">モジュール</a></div> 24<div id="page-content"> 25<div id="preamble"><h1>Apache モジュール mod_cache</h1> 26<div class="toplang"> 27<p><span>翻訳済み言語: </span><a href="/en/mod/mod_cache.html" hreflang="en" rel="alternate" title="English"> en </a> | 28<a href="/ja/mod/mod_cache.html" title="Japanese"> ja </a> | 29<a href="/ko/mod/mod_cache.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p> 30</div> 31<div class="outofdate">この日本語訳はすでに古くなっている 32 可能性があります。 33 最近更新された内容を見るには英語版をご覧下さい。 34 </div> 35<table class="module"><tr><th><a href="module-dict.html#Description">説明:</a></th><td>URI をキーにしたコンテンツのキャッシュ</td></tr> 36<tr><th><a href="module-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 37<tr><th><a href="module-dict.html#ModuleIdentifier">モジュール識別子:</a></th><td>cache_module</td></tr> 38<tr><th><a href="module-dict.html#SourceFile">ソースファイル:</a></th><td>mod_cache.c</td></tr></table> 39<h3>概要</h3> 40 41 <div class="warning">使用方法については注意する必要があり、 42 <code class="directive"><a href="/mod/mod_authz_host.html#allow">Allow</a></code> や 43 <code class="directive"><a href="/mod/mod_authz_host.html#deny">Deny</a></code> 44 ディレクティブを迂回する設定もできてしまいます。 45 ホスト名やアドレスや環境変数に基づいてクライアントからの 46 アクセスを制限したい場合は、キャッシュ機能を有効にすべきでは 47 ありません。</div> 48 49 <p><code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> はローカルのコンテンツやプロキシされた 50 コンテンツをキャッシュするために使われる <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616</a> 準拠の 51 HTTP コンテンツキャッシュを実装しています。<code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> 52 の動作にはストレージを管理するモジュールが必要です。標準 53 Apache 配布には二つストレージ管理モジュールが含まれています:</p> 54 55 <dl> 56 <dt><code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code></dt> 57 <dd>ディスクを使用したストレージ管理機構を実装しています。</dd> 58 59 <dt><code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code></dt> 60 <dd>メモリを使用したストレージ管理機構を実装しています。 61 <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> は次の二つのモードのどちらかで動作する 62 ように設定できます: オープンされているファイル記述子をキャッシュするモードか、 63 ヒープ上でのオブジェクトの自体をキャッシュをするモードです。 64 <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> はローカルで生成されるコンテンツや、 65 <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code> が 66 <code class="directive"><a href="/mod/mod_proxy.html#proxypass">ProxyPass</a></code> を使って設定されている 67 ときの (つまり<dfn>リバースプロキシ</dfn> での) バックエンドサーバの 68 コンテンツをキャッシュするのに使えます。</dd> 69 </dl> 70 71 <p>コンテンツのキャッシュへの保存と取得は URI に基づいたキーが使われます。 72 アクセス保護のかけられているコンテンツはキャッシュされません。</p> 73 <p>詳細や解説、例については 74 <a href="/caching.html">Caching Guide</a> を参照して下さい。</p> 75</div> 76<div id="quickview"><h3 class="directives">ディレクティブ</h3> 77<ul id="toc"> 78<li><img alt="" src="/images/down.gif" /> <a href="#cachedefaultexpire">CacheDefaultExpire</a></li> 79<li><img alt="" src="/images/down.gif" /> <a href="#cachedisable">CacheDisable</a></li> 80<li><img alt="" src="/images/down.gif" /> <a href="#cacheenable">CacheEnable</a></li> 81<li><img alt="" src="/images/down.gif" /> <a href="#cacheignorecachecontrol">CacheIgnoreCacheControl</a></li> 82<li><img alt="" src="/images/down.gif" /> <a href="#cacheignoreheaders">CacheIgnoreHeaders</a></li> 83<li><img alt="" src="/images/down.gif" /> <a href="#cacheignorenolastmod">CacheIgnoreNoLastMod</a></li> 84<li><img alt="" src="/images/down.gif" /> <a href="#cacheignorequerystring">CacheIgnoreQueryString</a></li> 85<li><img alt="" src="/images/down.gif" /> <a href="#cacheignoreurlsessionidentifiers">CacheIgnoreURLSessionIdentifiers</a></li> 86<li><img alt="" src="/images/down.gif" /> <a href="#cachelastmodifiedfactor">CacheLastModifiedFactor</a></li> 87<li><img alt="" src="/images/down.gif" /> <a href="#cachelock">CacheLock</a></li> 88<li><img alt="" src="/images/down.gif" /> <a href="#cachelockmaxage">CacheLockMaxAge</a></li> 89<li><img alt="" src="/images/down.gif" /> <a href="#cachelockpath">CacheLockPath</a></li> 90<li><img alt="" src="/images/down.gif" /> <a href="#cachemaxexpire">CacheMaxExpire</a></li> 91<li><img alt="" src="/images/down.gif" /> <a href="#cachestorenostore">CacheStoreNoStore</a></li> 92<li><img alt="" src="/images/down.gif" /> <a href="#cachestoreprivate">CacheStorePrivate</a></li> 93</ul> 94<h3>トピック</h3> 95<ul id="topics"> 96<li><img alt="" src="/images/down.gif" /> <a href="#related">関連モジュールとディレクティブ</a></li> 97<li><img alt="" src="/images/down.gif" /> <a href="#sampleconf">サンプル設定</a></li> 98</ul><h3>参照</h3> 99<ul class="seealso"> 100<li><a href="/caching.html">Caching Guide</a></li> 101</ul><ul class="seealso"><li><a href="#comments_section">コメント</a></li></ul></div> 102<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 103<div class="section"> 104<h2><a name="related" id="related">関連モジュールとディレクティブ</a></h2> 105 <table class="related"><tr><th>関連モジュール</th><th>関連ディレクティブ</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code></li><li><code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_disk_cache.html#cacheroot">CacheRoot</a></code></li><li><code class="directive"><a href="/mod/mod_disk_cache.html#cachedirlevels">CacheDirLevels</a></code></li><li><code class="directive"><a href="/mod/mod_disk_cache.html#cachedirlength">CacheDirLength</a></code></li><li><code class="directive"><a href="/mod/mod_disk_cache.html#cacheminfilesize">CacheMinFileSize</a></code></li><li><code class="directive"><a href="/mod/mod_disk_cache.html#cachemaxfilesize">CacheMaxFileSize</a></code></li><li><code class="directive"><a href="/mod/mod_mem_cache.html#mcachesize">MCacheSize</a></code></li><li><code class="directive"><a href="/mod/mod_mem_cache.html#mcachemaxobjectcount">MCacheMaxObjectCount</a></code></li><li><code class="directive"><a href="/mod/mod_mem_cache.html#mcacheminobjectsize">MCacheMinObjectSize</a></code></li><li><code class="directive"><a href="/mod/mod_mem_cache.html#mcachemaxobjectsize">MCacheMaxObjectSize</a></code></li><li><code class="directive"><a href="/mod/mod_mem_cache.html#mcacheremovalalgorithm">MCacheRemovalAlgorithm</a></code></li><li><code class="directive"><a href="/mod/mod_mem_cache.html#mcachemaxstreamingbuffer">MCacheMaxStreamingBuffer</a></code></li></ul></td></tr></table> 106</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 107<div class="section"> 108<h2><a name="sampleconf" id="sampleconf">サンプル設定</a></h2> 109 <div class="example"><h3>Sample httpd.conf</h3><p><code> 110 #<br /> 111 # Sample Cache Configuration<br /> 112 #<br /> 113 LoadModule cache_module modules/mod_cache.so<br /> 114 <br /> 115 <IfModule mod_cache.c><br /> 116 <span class="indent"> 117 #LoadModule disk_cache_module modules/mod_disk_cache.so<br /> 118 # If you want to use mod_disk_cache instead of mod_mem_cache,<br /> 119 # uncomment the line above and comment out the LoadModule line below.<br /> 120 <IfModule mod_disk_cache.c><br /> 121 <span class="indent"> 122 CacheRoot c:/cacheroot<br /> 123 CacheEnable disk /<br /> 124 CacheDirLevels 5<br /> 125 CacheDirLength 3<br /> 126 </span> 127 </IfModule> <br /> 128 <br /> 129 LoadModule mem_cache_module modules/mod_mem_cache.so<br /> 130 <IfModule mod_mem_cache.c><br /> 131 <span class="indent"> 132 CacheEnable mem /<br /> 133 MCacheSize 4096<br /> 134 MCacheMaxObjectCount 100<br /> 135 MCacheMinObjectSize 1<br /> 136 MCacheMaxObjectSize 2048<br /> 137 </span> 138 </IfModule><br /> 139 <br /> 140 # When acting as a proxy, don't cache the list of security updates<br /> 141 CacheDisable http://security.update.server/update-list/<br /> 142 </span> 143 </IfModule> 144 </code></p></div> 145</div> 146<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 147<div class="directive-section"><h2><a name="CacheDefaultExpire" id="CacheDefaultExpire">CacheDefaultExpire</a> <a name="cachedefaultexpire" id="cachedefaultexpire">ディレクティブ</a></h2> 148<table class="directive"> 149<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>期日が指定されていないときにドキュメントをキャッシュするデフォルトの期間</td></tr> 150<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheDefaultExpire <var>seconds</var></code></td></tr> 151<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheDefaultExpire 3600 (1時間)</code></td></tr> 152<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 153<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 154<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 155</table> 156 <p><code class="directive">CacheDefaultExpire</code> ディレクティブは、ドキュメントに 157 有効期限 (expiry) や最終修正時刻 (last-modified) が指定されていない場合の 158 デフォルトの時間を指定します。<code class="directive">CacheMaxExpire</code> 159 ディレクティブで指定された値はこの設定を上書き<em>しません</em>。</p> 160 161 <div class="example"><p><code> 162 CacheDefaultExpire 86400 163 </code></p></div> 164 165</div> 166<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 167<div class="directive-section"><h2><a name="CacheDisable" id="CacheDisable">CacheDisable</a> <a name="cachedisable" id="cachedisable">ディレクティブ</a></h2> 168<table class="directive"> 169<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>特定の URL をキャッシュしない</td></tr> 170<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheDisable <var> url-string</var></code></td></tr> 171<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 172<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 173<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 174</table> 175 <p><code class="directive">CacheDisable</code> ディレクティブで 176 <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> モジュールが <var>url-string</var> 以下の 177 URL をキャッシュ<em>しない</em>ようにします。</p> 178 179 <div class="example"><h3>例</h3><p><code> 180 CacheDisable /local_files 181 </code></p></div> 182 183</div> 184<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 185<div class="directive-section"><h2><a name="CacheEnable" id="CacheEnable">CacheEnable</a> <a name="cacheenable" id="cacheenable">ディレクティブ</a></h2> 186<table class="directive"> 187<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>指定したストレージ管理方式を使ってのキャッシュを有効にする</td></tr> 188<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheEnable <var>cache_type</var> <var>url-string</var></code></td></tr> 189<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 190<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 191<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 192</table> 193 <p><code class="directive">CacheEnable</code> ディレクティブで <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> 194 モジュールが <var>url-string</var> 以下の URL をキャッシュするようにします。 195 キャッシュストレージ管理方式は <var>cache_type</var> 引数で指定します。 196 <var>cache_type</var> <code> mem</code> で、 197 <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> で実装されているメモリを使ったストレージ 198 管理方式を使うように <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> に指示します。 199 <var>cache_type</var> <code>disk</code> で、 200 <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code> で実装されているディスクを使ったストレージ 201 管理を使うように <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> に指示します。 202 <var>cache_type</var> <code>fd</code> は <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> に 203 <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> により実装されているファイル記述子の 204 キャッシュを使うように指示します。</p> 205 206 <p>(下の例のように) <code class="directive">CacheEnable</code> ディレクティブの 207 URL 空間が重複しているときは、該当するストレージ方式を順に試して、 208 実際にリクエストの処理ができると、その方式で処理します。 209 ストレージ管理方式が実行される順番は設定ファイル中の 210 <code class="directive">CacheEnable</code> の順番により決定されます。</p> 211 212 <div class="example"><p><code> 213 CacheEnable mem /manual<br /> 214 CacheEnable fd /images<br /> 215 CacheEnable disk /<br /> 216 </code></p></div> 217 218 <p>フォワードプロクシサーバとして動作させる場合は、 219 <var>url-string</var> でリモートサイトとプロクシするプロトコルを 220 指定して、何に対してキャッシュを有効にするか指定することもできます。</p> 221 222 <div class="example"><p><code> 223 # Cache proxied url's<br /> 224 CacheEnable disk /<br /><br /> 225 # Cache FTP-proxied url's<br /> 226 CacheEnable disk ftp://<br /><br /> 227 # Cache content from www.apache.org<br /> 228 CacheEnable disk http://www.apache.org/<br /> 229 </code></p></div> 230 231 232</div> 233<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 234<div class="directive-section"><h2><a name="CacheIgnoreCacheControl" id="CacheIgnoreCacheControl">CacheIgnoreCacheControl</a> <a name="cacheignorecachecontrol" id="cacheignorecachecontrol">ディレクティブ</a></h2> 235<table class="directive"> 236<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>キャッシュされているコンテンツを返さないようにクライアントから 237リクエストされても無視する</td></tr> 238<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheIgnoreCacheControl On|Off</code></td></tr> 239<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheIgnoreCacheControl Off</code></td></tr> 240<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 241<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 242<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 243</table> 244 <p>Cache-Control: no-cache ヘッダや Pragma: no-store ヘッダのあるリクエストに 245 対しては、通常キャッシュを使いません。<code class="directive">CacheIgnoreCacheControl</code> 246 ディレクティブを使うと、この動作を上書きできます。 247 <code class="directive">CacheIgnoreCacheControl</code> On とすると、 248 リクエストに no-cache という値があっても、キャッシュを使ってドキュメントを 249 返すようになります。認証を必要とするドキュメントは<em>決して</em> 250 キャッシュされません。</p> 251 252 <div class="example"><p><code> 253 CacheIgnoreCacheControl On 254 </code></p></div> 255 256 <div class="warning"><h3>警告</h3> 257 このディレクティブを使うと、ドキュメント取得時にキャッシュを使わないように 258 クライアントがリクエストしているにもかかわらず、キャッシュを 259 使うようになります。その結果、 260 古いコンテンツが送られ続けることになってしまうかもしれません。 261 </div> 262 263<h3>参照</h3> 264<ul> 265<li><code class="directive"><a href="#cachestoreprivate">CacheStorePrivate</a></code></li> 266<li><code class="directive"><a href="#cachestorenostore">CacheStoreNoStore</a></code></li> 267</ul> 268</div> 269<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 270<div class="directive-section"><h2><a name="CacheIgnoreHeaders" id="CacheIgnoreHeaders">CacheIgnoreHeaders</a> <a name="cacheignoreheaders" id="cacheignoreheaders">ディレクティブ</a></h2> 271<table class="directive"> 272<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>指定された HTTP ヘッダをキャッシュに保存しない。 273</td></tr> 274<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheIgnoreHeaders <var>header-string</var> [<var>header-string</var>] ...</code></td></tr> 275<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheIgnoreHeaders None</code></td></tr> 276<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 277<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 278<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 279</table> 280 <p>RFC 2616 によると、hop-by-hop HTTP ヘッダはキャッシュには保管されません。 281 以下のヘッダは hop-by-hop ヘッダに該当しますので、 282 <code class="directive">CacheIgnoreHeaders</code> 283 の設定に<em>関係なく</em>キャッシュには保管されません:</p> 284 <ul> 285 <li><code>Connection</code></li> 286 <li><code>Keep-Alive</code></li> 287 <li><code>Proxy-Authenticate</code></li> 288 <li><code>Proxy-Authorization</code></li> 289 <li><code>TE</code></li> 290 <li><code>Trailers</code></li> 291 <li><code>Transfer-Encoding</code></li> 292 <li><code>Upgrade</code></li> 293 </ul> 294 295 <p><code class="directive">CacheIgnoreHeaders</code> で 296 キャッシュに保管しない追加の HTTP ヘッダを指定します。 297 例えば、クッキーをキャッシュに保管しないようにした方がよい場合も 298 あるでしょう。</p> 299 300 <p><code class="directive">CacheIgnoreHeaders</code> の引数は、 301 キャッシュに保管しない HTTP ヘッダを空白区切りにしたリスト形式です。 302 キャッシュに保管しないヘッダが hop-by-hop ヘッダだけの場合 303 (RFC 2616 準拠の動作のとき) は、 304 <code class="directive">CacheIgnoreHeaders</code> を <code>None</code> 305 に設定できます。</p> 306 307 <div class="example"><h3>例 1</h3><p><code> 308 CacheIgnoreHeaders Set-Cookie 309 </code></p></div> 310 311 <div class="example"><h3>例 2</h3><p><code> 312 CacheIgnoreHeaders None 313 </code></p></div> 314 315 <div class="warning"><h3>警告:</h3> 316 <code>Expires</code> のような適切のキャッシュ管理のために必要な 317 ヘッダが <code class="directive">CacheIgnoreHeaders</code> の設定により 318 保管されていないときは、mod_cache の動作は定義されていません。 319 </div> 320 321</div> 322<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 323<div class="directive-section"><h2><a name="CacheIgnoreNoLastMod" id="CacheIgnoreNoLastMod">CacheIgnoreNoLastMod</a> <a name="cacheignorenolastmod" id="cacheignorenolastmod">ディレクティブ</a></h2> 324<table class="directive"> 325<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>応答に Last Modified が無くても気にしないようにする</td></tr> 326<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheIgnoreNoLastMod On|Off</code></td></tr> 327<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheIgnoreNoLastMod Off</code></td></tr> 328<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 329<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 330<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 331</table> 332 <p>通常、Last-Modified による最終修正時刻の無いドキュメントはキャッシュ 333 されません。(例えば <code class="module"><a href="/mod/mod_include.html">mod_include</a></code> による処理のときなどに) 334 Last-Modified 時刻が消去されたり、そもそも最初から提供されていない 335 状況があります。<code class="directive">CacheIgnoreNoLastMod</code> 336 ディレクティブを使うと、Last-Modified 日時が指定されていない 337 ドキュメントでもキャッシュするように指定できます。ドキュメントに 338 最終修正時刻 (Last-Modified) 有効期限 (expiry) がない場合は、有効期限の 339 生成に <code class="directive">CacheDefaultExpire</code> が使われます。</p> 340 341 <div class="example"><p><code> 342 CacheIgnoreNoLastMod On 343 </code></p></div> 344 345</div> 346<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 347<div class="directive-section"><h2><a name="CacheIgnoreQueryString" id="CacheIgnoreQueryString">CacheIgnoreQueryString</a> <a name="cacheignorequerystring" id="cacheignorequerystring">ディレクティブ</a></h2> 348<table class="directive"> 349<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>Ignore query string when caching</td></tr> 350<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheIgnoreQueryString On|Off</code></td></tr> 351<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheIgnoreQueryString Off</code></td></tr> 352<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 353<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 354<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 355<tr><th><a href="directive-dict.html#Compatibility">互換性:</a></th><td>Available in Apache 2.2.6 and later</td></tr> 356</table><p>このディレクティブの解説文書は 357 まだ翻訳されていません。英語版をご覧ください。 358 </p></div> 359<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 360<div class="directive-section"><h2><a name="CacheIgnoreURLSessionIdentifiers" id="CacheIgnoreURLSessionIdentifiers">CacheIgnoreURLSessionIdentifiers</a> <a name="cacheignoreurlsessionidentifiers" id="cacheignoreurlsessionidentifiers">ディレクティブ</a></h2> 361<table class="directive"> 362<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>Ignore defined session identifiers encoded in the URL when caching 363</td></tr> 364<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheIgnoreURLSessionIdentifiers <var>identifier</var> [<var>identifier</var>] ...</code></td></tr> 365<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheIgnoreURLSessionIdentifiers None</code></td></tr> 366<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 367<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 368<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 369</table><p>このディレクティブの解説文書は 370 まだ翻訳されていません。英語版をご覧ください。 371 </p></div> 372<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 373<div class="directive-section"><h2><a name="CacheLastModifiedFactor" id="CacheLastModifiedFactor">CacheLastModifiedFactor</a> <a name="cachelastmodifiedfactor" id="cachelastmodifiedfactor">ディレクティブ</a></h2> 374<table class="directive"> 375<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>LastModified の日付に基づいて有効期限 (expiry) 376を計算するための重みを指定する 377</td></tr> 378<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheLastModifiedFactor <var>float</var></code></td></tr> 379<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheLastModifiedFactor 0.1</code></td></tr> 380<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 381<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 382<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 383</table> 384 <p>ドキュメントに Last-Modified の日付が無いけれども有効期限 (expiry) 385 の日付があるというときに、有効期限を最終修正時刻からの経過時間として 386 計算するようにできます。有効期限を次の計算式に従って生成するのですが、 387 そのときに使われる <var>factor</var> を 388 <code class="directive">CacheLastModifiedFactor</code> ディレクティブで指定します。 389 </p> 390 391 <p><code>expiry-period = time-since-last-modified-date * <var>factor</var> 392 expiry-date = current-date + expiry-period</code></p> 393 394 <p>例えば、ドキュメントが 10 時間前に最後に修正されていて、 395 <var>factor</var> が 0.1 であれば、期日は 10*0.1 = 1 時間に 396 設定されます。現在時刻が 3:00pm であれば、計算された期日は 397 3:00pm + 1hour = 4:00pm になります。</p> 398 399 <p>期日が <code class="directive">CacheMaxExpire</code> で設定されている値 400 より大きくなってしまっている場合は、<code class="directive">CacheMaxExpire</code> 401 の設定値が優先されます。</p> 402 403 <div class="example"><p><code> 404 CacheLastModifiedFactor 0.5 405 </code></p></div> 406 407</div> 408<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 409<div class="directive-section"><h2><a name="CacheLock" id="CacheLock">CacheLock</a> <a name="cachelock" id="cachelock">ディレクティブ</a></h2> 410<table class="directive"> 411<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>Enable the thundering herd lock.</td></tr> 412<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheLock <var>on|off</var></code></td></tr> 413<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheLock off</code></td></tr> 414<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 415<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 416<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 417<tr><th><a href="directive-dict.html#Compatibility">互換性:</a></th><td>Available in Apache 2.2.15 and later</td></tr> 418</table><p>このディレクティブの解説文書は 419 まだ翻訳されていません。英語版をご覧ください。 420 </p></div> 421<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 422<div class="directive-section"><h2><a name="CacheLockMaxAge" id="CacheLockMaxAge">CacheLockMaxAge</a> <a name="cachelockmaxage" id="cachelockmaxage">ディレクティブ</a></h2> 423<table class="directive"> 424<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>Set the maximum possible age of a cache lock.</td></tr> 425<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheLockMaxAge <var>integer</var></code></td></tr> 426<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheLockMaxAge 5</code></td></tr> 427<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 428<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 429<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 430</table><p>このディレクティブの解説文書は 431 まだ翻訳されていません。英語版をご覧ください。 432 </p></div> 433<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 434<div class="directive-section"><h2><a name="CacheLockPath" id="CacheLockPath">CacheLockPath</a> <a name="cachelockpath" id="cachelockpath">ディレクティブ</a></h2> 435<table class="directive"> 436<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>Set the lock path directory.</td></tr> 437<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheLockPath <var>directory</var></code></td></tr> 438<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheLockPath /tmp/mod_cache-lock</code></td></tr> 439<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 440<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 441<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 442</table><p>このディレクティブの解説文書は 443 まだ翻訳されていません。英語版をご覧ください。 444 </p></div> 445<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 446<div class="directive-section"><h2><a name="CacheMaxExpire" id="CacheMaxExpire">CacheMaxExpire</a> <a name="cachemaxexpire" id="cachemaxexpire">ディレクティブ</a></h2> 447<table class="directive"> 448<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>ドキュメントをキャッシュする最大時間を秒数で表したもの</td></tr> 449<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheMaxExpire <var>seconds</var></code></td></tr> 450<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheMaxExpire 86400 (一日)</code></td></tr> 451<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 452<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 453<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 454</table> 455 <p><code class="directive">CacheMaxExpire</code> ディレクティブは、 456 キャッシュする HTTP ドキュメントを、元のサーバに問い合わせないまま最大何秒 457 保持してもよいかを指定します。つまり、ドキュメントは最大でこの秒数間ぶん古く 458 なることになります。この最大値は、(訳注:レスポンス中で)ドキュメントと共に 459 ドキュメントの期日が提供されている場合でも適用されます。</p> 460 461 <div class="example"><p><code> 462 CacheMaxExpire 604800 463 </code></p></div> 464 465</div> 466<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 467<div class="directive-section"><h2><a name="CacheStoreNoStore" id="CacheStoreNoStore">CacheStoreNoStore</a> <a name="cachestorenostore" id="cachestorenostore">ディレクティブ</a></h2> 468<table class="directive"> 469<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>no-store と指定されているレスポンスのキャッシュを試みる。</td></tr> 470<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheStoreNoStore On|Off</code></td></tr> 471<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheStoreNoStore Off</code></td></tr> 472<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 473<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 474<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 475</table> 476 <p>通常 Cache-Control: no-store ヘッダのついているレスポンスは 477 キャッシュされません。<code class="directive">CacheStoreNoCache</code> 478 ディレクティブでこの挙動を上書きできます。 479 <code class="directive">CacheStoreNoCache</code> On で no-store ヘッダのついている 480 リソースに対してもキャッシュを試みるようになります。 481 ただし認証の求められるリソースは <em>決して</em> キャッシュされません。</p> 482 483 <div class="example"><p><code> 484 CacheStoreNoStore On 485 </code></p></div> 486 487 <div class="warning"><h3>警告:</h3> 488 RFC 2616 に記載されているように no-store ディレクティブは、 489 "不注意による機密情報の漏洩や残留 (バックアップテープ等) を防ぐ" 490 目的で使われますが、このオプションを有効にすると、 491 機密情報を保持することになってしまいます。 492 ですので、ここで警告しておきます。 493 </div> 494 495<h3>参照</h3> 496<ul> 497<li><code class="directive"><a href="#cacheignorecachecontrol">CacheIgnoreCacheControl</a></code></li> 498<li><code class="directive"><a href="#cachestoreprivate">CacheStorePrivate</a></code></li> 499</ul> 500</div> 501<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 502<div class="directive-section"><h2><a name="CacheStorePrivate" id="CacheStorePrivate">CacheStorePrivate</a> <a name="cachestoreprivate" id="cachestoreprivate">ディレクティブ</a></h2> 503<table class="directive"> 504<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>private と指定されているレスポンスのキャッシュを試みる。</td></tr> 505<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheStorePrivate On|Off</code></td></tr> 506<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheStorePrivate Off</code></td></tr> 507<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr> 508<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 509<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_cache</td></tr> 510</table> 511 <p>通常 Cache-Control: private ヘッダのついているレスポンスは 512 キャッシュされません。<code class="directive">CacheStorePrivate</code> 513 ディレクティブでこの挙動を上書きできます。 514 <code class="directive">CacheStorePrivate</code> On で private ヘッダのついている 515 リソースに対してもキャッシュを試みるようになります。 516 ただし認証の求められるリソースは <em>決して</em> キャッシュされません。</p> 517 518 <div class="example"><p><code> 519 CacheStorePrivate On 520 </code></p></div> 521 522 <div class="warning"><h3>警告:</h3> 523 上流サーバがキャッシュしないように指定してきても、 524 それを無視してキャッシュするようになります。 525 望ましい挙動になるのは、本当に 'private' なキャッシュについてのみでしょう。 526 </div> 527 528<h3>参照</h3> 529<ul> 530<li><code class="directive"><a href="#cacheignorecachecontrol">CacheIgnoreCacheControl</a></code></li> 531<li><code class="directive"><a href="#cachestorenostore">CacheStoreNoStore</a></code></li> 532</ul> 533</div> 534</div> 535<div class="bottomlang"> 536<p><span>翻訳済み言語: </span><a href="/en/mod/mod_cache.html" hreflang="en" rel="alternate" title="English"> en </a> | 537<a href="/ja/mod/mod_cache.html" title="Japanese"> ja </a> | 538<a href="/ko/mod/mod_cache.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p> 539</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">コメント</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> 540<script type="text/javascript"><!--//--><![CDATA[//><!-- 541var comments_shortname = 'httpd'; 542var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_cache.html'; 543(function(w, d) { 544 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 545 d.write('<div id="comments_thread"><\/div>'); 546 var s = d.createElement('script'); 547 s.type = 'text/javascript'; 548 s.async = true; 549 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 550 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 551 } 552 else { 553 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 554 } 555})(window, document); 556//--><!]]></script></div><div id="footer"> 557<p class="apache">Copyright 2013 The Apache Software Foundation.<br />この文書は <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p> 558<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- 559if (typeof(prettyPrint) !== 'undefined') { 560 prettyPrint(); 561} 562//--><!]]></script> 563</body></html>