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_mem_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_mem_cache</h1> 26<div class="toplang"> 27<p><span>翻訳済み言語: </span><a href="/en/mod/mod_mem_cache.html" hreflang="en" rel="alternate" title="English"> en </a> | 28<a href="/ja/mod/mod_mem_cache.html" title="Japanese"> ja </a> | 29<a href="/ko/mod/mod_mem_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>mem_cache_module</td></tr> 38<tr><th><a href="module-dict.html#SourceFile">ソースファイル:</a></th><td>mod_mem_cache.c</td></tr></table> 39<h3>概要</h3> 40 41 <p>このモジュールは <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> を<em>必要とします</em>。 42 これは <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> のサポートモジュールとして 43 動作し、メモリを使用したストレージ管理機構を提供します。 44 <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> は二つのモードのどちらかで動作するように 45 設定できます: ファイル記述子のキャッシュかヒープ中のオブジェクトの 46 キャッシュです。ローカルで生成されたコンテンツに対してキャッシュするときや、 47 <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code> を使って <code class="directive"><a href="/mod/mod_proxy.html#proxypass">ProxyPass</a></code> (つまり<dfn>リバースプロキシ</dfn>向け) に設定したときのバックエンドサーバのコンテンツに対して 48 キャッシュをするときに、たいへん効果的です。</p> 49 50 <p>コンテンツのキャッシュへの保存と取得は URI に基づいたキーが使われます。 51 アクセス保護のかけられているコンテンツはキャッシュされません。</p> 52</div> 53<div id="quickview"><h3 class="directives">ディレクティブ</h3> 54<ul id="toc"> 55<li><img alt="" src="/images/down.gif" /> <a href="#mcachemaxobjectcount">MCacheMaxObjectCount</a></li> 56<li><img alt="" src="/images/down.gif" /> <a href="#mcachemaxobjectsize">MCacheMaxObjectSize</a></li> 57<li><img alt="" src="/images/down.gif" /> <a href="#mcachemaxstreamingbuffer">MCacheMaxStreamingBuffer</a></li> 58<li><img alt="" src="/images/down.gif" /> <a href="#mcacheminobjectsize">MCacheMinObjectSize</a></li> 59<li><img alt="" src="/images/down.gif" /> <a href="#mcacheremovalalgorithm">MCacheRemovalAlgorithm</a></li> 60<li><img alt="" src="/images/down.gif" /> <a href="#mcachesize">MCacheSize</a></li> 61</ul> 62<h3>参照</h3> 63<ul class="seealso"> 64<li><code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code></li> 65<li><code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code></li> 66</ul><ul class="seealso"><li><a href="#comments_section">コメント</a></li></ul></div> 67 68<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 69<div class="directive-section"><h2><a name="MCacheMaxObjectCount" id="MCacheMaxObjectCount">MCacheMaxObjectCount</a> <a name="mcachemaxobjectcount" id="mcachemaxobjectcount">ディレクティブ</a></h2> 70<table class="directive"> 71<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>キャッシュに保管されるオブジェクトの最大数</td></tr> 72<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>MCacheMaxObjectCount <var>value</var></code></td></tr> 73<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>MCacheMaxObjectCount 1009</code></td></tr> 74<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル</td></tr> 75<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 76<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_mem_cache</td></tr> 77</table> 78 <p><code class="directive">MCacheMaxObjectCount</code> ディレクティブは 79 キャッシュされるオブジェクトの最大数を指定します。 80 この値はハッシュテーブルを作成するときに使われます。 81 新しいオブジェクトを挿入するときに、オブジェクトの最大数に 82 達してしまっているとき、新しいオブジェクトをキャッシュできるように、 83 オブジェクトを一つ消去します。オブジェクトは 84 <code class="directive"><a href="#mcacheremovalalgorithm">MCacheRemovalAlgorithm</a></code> 85 で指定されたアルゴリズムに従って削除されます。</p> 86 87 <div class="example"><h3>例</h3><p><code> 88 MCacheMaxObjectCount 13001 89 </code></p></div> 90 91</div> 92<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 93<div class="directive-section"><h2><a name="MCacheMaxObjectSize" id="MCacheMaxObjectSize">MCacheMaxObjectSize</a> <a name="mcachemaxobjectsize" id="mcachemaxobjectsize">ディレクティブ</a></h2> 94<table class="directive"> 95<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>キャッシュに保管できるドキュメントの最大サイズ (バイト)</td></tr> 96<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>MCacheMaxObjectSize <var>bytes</var></code></td></tr> 97<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>MCacheMaxObjectSize 10000</code></td></tr> 98<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル</td></tr> 99<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 100<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_mem_cache</td></tr> 101</table> 102 <p><code class="directive">MCacheMaxObjectSize</code> はドキュメントを 103 キャッシュするかどうかを判定する、最大のサイズをバイト数で設定します。</p> 104 105 <div class="example"><h3>例</h3><p><code> 106 MCacheMaxObjectSize 6400000 107 </code></p></div> 108 109 <div class="note"><h3>注</h3> 110 <p><code class="directive">MCacheMaxObjectSize</code> の値は <code class="directive"><a href="#mcacheminobjectsize">MCacheMinObjectSize</a></code> 111 で指定した値よりも大きくなければなりません。</p> 112 </div> 113 114</div> 115<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 116<div class="directive-section"><h2><a name="MCacheMaxStreamingBuffer" id="MCacheMaxStreamingBuffer">MCacheMaxStreamingBuffer</a> <a name="mcachemaxstreamingbuffer" id="mcachemaxstreamingbuffer">ディレクティブ</a></h2> 117<table class="directive"> 118<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>ストリームされている応答をキャッシュ不能と決定するまでに 119メモリにバッファする最大量</td></tr> 120<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>MCacheMaxStreamingBuffer <var>size_in_bytes</var></code></td></tr> 121<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>MCacheMaxStreamingBuffer of 100000 か MCacheMaxObjectSize の少い方</code></td></tr> 122<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル</td></tr> 123<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 124<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_mem_cache</td></tr> 125</table> 126 <p><code class="directive">MCacheMaxStreamingBuffer</code> ディレクティブは、 127 サイズが大きすぎてキャッシュできないと判断するまでの、 128 ストリーム応答のバッファのための最大バイト数を指定します。 129 ストリーム応答とは、コンテンツの全体がすぐには得られず、 130 <code>Content-Length</code> がわからない応答を指します。 131 ストリーム応答を行なうようなものにはプロキシされた応答や、 132 CGI スクリプトの出力などがあります。デフォルトではストリームの応答は 133 <code>Content-Length</code> がない限りキャッシュ<em>されません</em>。 134 このような動作になっている理由は、結局キャッシュに収まりきらないと 135 判断することになってしまうような、サイズの大きな応答のバッファリングに、 136 大量のメモリが消費されるのを避けるためです。 137 <code class="directive">MCacheMaxStreamingBuffer</code> ディレクティブを使うと、 138 <code>Content-Length</code> を含まない応答に対して指定された最大量まで 139 バッファするようにできます。バッファを使い切ると、バッファ中の 140 コンテンツは捨てられ、キャッシュ動作を中止します。</p> 141 142 <div class="note"><h3>注:</h3> 143 <p><code class="directive">MCacheMaxStreamingBuffer</code> に非零の値を 144 使っても、クライアントへの応答の転送に特に遅延は発生しません。 145 <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> はストリームコンテンツの断片を 146 バッファにコピーした後、即座に、その部分をクライアントへの配送の 147 次段の出力フィルタに送ります。</p> 148 </div> 149 150 <div class="example"><p><code> 151 # Enable caching of streamed responses up to 64KB:<br /> 152 MCacheMaxStreamingBuffer 65536 153 </code></p></div> 154 155</div> 156<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 157<div class="directive-section"><h2><a name="MCacheMinObjectSize" id="MCacheMinObjectSize">MCacheMinObjectSize</a> <a name="mcacheminobjectsize" id="mcacheminobjectsize">ディレクティブ</a></h2> 158<table class="directive"> 159<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>キャッシュに保管されるドキュメントの最小サイズ (バイト)</td></tr> 160<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>MCacheMinObjectSize <var>bytes</var></code></td></tr> 161<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>MCacheMinObjectSize 0</code></td></tr> 162<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル</td></tr> 163<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 164<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_mem_cache</td></tr> 165</table> 166 <p><code class="directive">MCacheMinObjectSize</code> ディレクティブは、ドキュメントを 167 キャッシュするかどうかを判定する、最小のサイズをバイト数で設定します。</p> 168 169 <div class="example"><h3>例</h3><p><code> 170 MCacheMinObjectSize 10000 171 </code></p></div> 172 173</div> 174<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 175<div class="directive-section"><h2><a name="MCacheRemovalAlgorithm" id="MCacheRemovalAlgorithm">MCacheRemovalAlgorithm</a> <a name="mcacheremovalalgorithm" id="mcacheremovalalgorithm">ディレクティブ</a></h2> 176<table class="directive"> 177<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>キャッシュから削除するドキュメントを選ぶためのアルゴリズム</td></tr> 178<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>MCacheRemovalAlgorithm LRU|GDSF</code></td></tr> 179<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>MCacheRemovalAlgorithm GDSF</code></td></tr> 180<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル</td></tr> 181<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 182<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_mem_cache</td></tr> 183</table> 184 <p><code class="directive">MCacheRemovalAlgorithm</code> ディレクティブは、 185 キャッシュから削除するドキュメントを選択するためのアルゴリズムを 186 指定します。選択肢は二つあります:</p> 187 188 <dl> 189 <dt><code>LRU</code> (Least Recently Used)</dt> 190 <dd><code>LRU</code> 一番長くアクセスされていないドキュメントを削除します。 191 </dd> 192 193 <dt><code>GDSF</code> (GreadyDual-Size)</dt> 194 <dd><code>GDSF</code> はキャッシュミスのコストとドキュメントのサイズをもとに、 195 ドキュメントのキャッシュに対して優先度をつけます。 196 優先度の一番低いドキュメントが最初に削除されます。</dd> 197 </dl> 198 199 <div class="example"><h3>例</h3><p><code> 200 MCacheRemovalAlgorithm GDSF<br /> 201 MCacheRemovalAlgorithm LRU 202 </code></p></div> 203 204</div> 205<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 206<div class="directive-section"><h2><a name="MCacheSize" id="MCacheSize">MCacheSize</a> <a name="mcachesize" id="mcachesize">ディレクティブ</a></h2> 207<table class="directive"> 208<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>キャッシュに使われるメモリの最大量をバイト単位で指定</td></tr> 209<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>MCacheSize <var>KBytes</var></code></td></tr> 210<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>MCacheSize 100</code></td></tr> 211<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル</td></tr> 212<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 213<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_mem_cache</td></tr> 214</table> 215 <p><code class="directive">MCacheSize</code> ディレクティブはキャッシュに 216 使われるメモリの大きさをキロバイト (1024 バイト単位) で設定します。 217 新しいオブジェクトをキャッシュに挿入することになり、オブジェクトの 218 サイズが残りのメモリより大きい場合は、その新しいオブジェクトの挿入が 219 可能になるまで、古いオブジェクトが削除されていきます。 220 オブジェクトは <code class="directive"><a href="#mcacheremovalalgorithm">MCacheRemovalAlgorithm</a></code> 221 で指定したアルゴリズムに従って削除されます。</p> 222 223 <div class="example"><h3>例</h3><p><code> 224 MCacheSize 700000 225 </code></p></div> 226 227 <div class="note"><h3>注</h3> 228 <p><code class="directive">MCacheSize</code> の値は <code class="directive"><a href="#mcachemaxobjectsize">MCacheMaxObjectSize</a></code> ディレクティブで指定した値より 229 大きくなければなりません。</p> 230 </div> 231 232</div> 233</div> 234<div class="bottomlang"> 235<p><span>翻訳済み言語: </span><a href="/en/mod/mod_mem_cache.html" hreflang="en" rel="alternate" title="English"> en </a> | 236<a href="/ja/mod/mod_mem_cache.html" title="Japanese"> ja </a> | 237<a href="/ko/mod/mod_mem_cache.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p> 238</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> 239<script type="text/javascript"><!--//--><![CDATA[//><!-- 240var comments_shortname = 'httpd'; 241var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_mem_cache.html'; 242(function(w, d) { 243 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 244 d.write('<div id="comments_thread"><\/div>'); 245 var s = d.createElement('script'); 246 s.type = 'text/javascript'; 247 s.async = true; 248 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 249 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 250 } 251 else { 252 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 253 } 254})(window, document); 255//--><!]]></script></div><div id="footer"> 256<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> 257<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[//><!-- 258if (typeof(prettyPrint) !== 'undefined') { 259 prettyPrint(); 260} 261//--><!]]></script> 262</body></html>