home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / CMCD1104.ISO / Software / Complet / Apache / apache_2.0.52-win32-x86-no_ssl.msi / Data.Cab / F278086_mod_mem_cache.html.en < prev    next >
Extensible Markup Language  |  2004-09-22  |  16KB  |  239 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  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="en" xml:lang="en"><head><!--
  4.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  5.               This file is generated from xml source: DO NOT EDIT
  6.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  7.       -->
  8. <title>mod_mem_cache - Apache HTTP Server</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" />
  12. <link href="../images/favicon.ico" rel="shortcut icon" /></head>
  13. <body>
  14. <div id="page-header">
  15. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
  16. <p class="apache">Apache HTTP Server Version 2.0</p>
  17. <img alt="" src="../images/feather.gif" /></div>
  18. <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
  19. <div id="path">
  20. <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="../">Version 2.0</a> > <a href="./">Modules</a></div>
  21. <div id="page-content">
  22. <div id="preamble"><h1>Apache Module mod_mem_cache</h1>
  23. <div class="toplang">
  24. <p><span>Available Languages: </span><a href="../en/mod/mod_mem_cache.html" title="English"> en </a> |
  25. <a href="../ko/mod/mod_mem_cache.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
  26. </div>
  27. <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Content cache keyed to URIs</td></tr>
  28. <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
  29. <tr><th><a href="module-dict.html#ModuleIdentifier">ModuleáIdentifier:</a></th><td>mem_cache_module</td></tr>
  30. <tr><th><a href="module-dict.html#SourceFile">SourceáFile:</a></th><td>mod_mem_cache.c</td></tr></table>
  31. <h3>Summary</h3>
  32.  
  33.     <div class="warning">
  34.       This module is experimental. Documentation is still under
  35.       development...
  36.     </div>
  37.  
  38.     <p>This module <em>requires</em> the service of <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>. It acts as a support module for <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> and provides a memory based storage manager.
  39.     <code class="module"><a href="../mod/mod_mem_cache.html">mod_mem_cache</a></code> can be configured to operate in two
  40.     modes: caching open file descriptors or caching objects in heap storage.
  41.     <code class="module"><a href="../mod/mod_mem_cache.html">mod_mem_cache</a></code> is most useful when used to cache locally
  42.     generated content or to cache backend server content for <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> configured for <code class="directive"><a href="../mod/mod_proxy.html#proxypass">ProxyPass</a></code> (aka <dfn>reverse proxy</dfn>).</p>
  43.  
  44.     <p>Content is stored in and retrieved from the cache using URI based
  45.     keys. Content with access protection is not cached.</p>
  46. </div>
  47. <div id="quickview"><h3 class="directives">Directives</h3>
  48. <ul id="toc">
  49. <li><img alt="" src="../images/down.gif" /> <a href="#mcachemaxobjectcount">MCacheMaxObjectCount</a></li>
  50. <li><img alt="" src="../images/down.gif" /> <a href="#mcachemaxobjectsize">MCacheMaxObjectSize</a></li>
  51. <li><img alt="" src="../images/down.gif" /> <a href="#mcachemaxstreamingbuffer">MCacheMaxStreamingBuffer</a></li>
  52. <li><img alt="" src="../images/down.gif" /> <a href="#mcacheminobjectsize">MCacheMinObjectSize</a></li>
  53. <li><img alt="" src="../images/down.gif" /> <a href="#mcacheremovalalgorithm">MCacheRemovalAlgorithm</a></li>
  54. <li><img alt="" src="../images/down.gif" /> <a href="#mcachesize">MCacheSize</a></li>
  55. </ul>
  56. <h3>See also</h3>
  57. <ul class="seealso">
  58. <li><code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code></li>
  59. <li><code class="module"><a href="../mod/mod_disk_cache.html">mod_disk_cache</a></code></li>
  60. </ul></div>
  61.  
  62. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  63. <div class="directive-section"><h2><a name="MCacheMaxObjectCount" id="MCacheMaxObjectCount">MCacheMaxObjectCount</a> <a name="mcachemaxobjectcount" id="mcachemaxobjectcount">Directive</a></h2>
  64. <table class="directive">
  65. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The maximum number of objects allowed to be placed in the
  66. cache</td></tr>
  67. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MCacheMaxObjectCount <var>value</var></code></td></tr>
  68. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MCacheMaxObjectCount 1009</code></td></tr>
  69. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  70. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
  71. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mem_cache</td></tr>
  72. </table>
  73.     <p>The <code class="directive">MCacheMaxObjectCount</code> directive sets the
  74.     maximum number of objects to be cached. The value is used to create the
  75.     open hash table. If a new object needs to be inserted in the cache and
  76.     the maximum number of objects has been reached, an object will be
  77.     removed to allow the new object to be cached. The object to be removed
  78.     is selected using the algorithm specified by <code class="directive"><a href="#mcacheremovalalgorithm">MCacheRemovalAlgorithm</a></code>.</p>
  79.  
  80.     <div class="example"><h3>Example</h3><p><code>
  81.       MCacheMaxObjectCount 13001
  82.     </code></p></div>
  83.  
  84. </div>
  85. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  86. <div class="directive-section"><h2><a name="MCacheMaxObjectSize" id="MCacheMaxObjectSize">MCacheMaxObjectSize</a> <a name="mcachemaxobjectsize" id="mcachemaxobjectsize">Directive</a></h2>
  87. <table class="directive">
  88. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The maximum size (in bytes) of a document allowed in the
  89. cache</td></tr>
  90. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MCacheMaxObjectSize <var>bytes</var></code></td></tr>
  91. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MCacheMaxObjectSize 10000</code></td></tr>
  92. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  93. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
  94. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mem_cache</td></tr>
  95. </table>
  96.     <p>The <code class="directive">MCacheMaxObjectSize</code> directive sets the
  97.     maximum allowable size, in bytes, of a document for it to be considered
  98.     cacheable.</p>
  99.  
  100.     <div class="example"><h3>Example</h3><p><code>
  101.       MCacheMaxObjectSize 6400000
  102.     </code></p></div>
  103.  
  104.     <div class="note"><h3>Note</h3>
  105.       <p>The value of <code class="directive">MCacheMaxObjectSize</code> must be
  106.       greater than the value specified by the <code class="directive"><a href="#mcacheminobjectsize">MCacheMinObjectSize</a></code> directive.</p>
  107.     </div>
  108.  
  109. </div>
  110. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  111. <div class="directive-section"><h2><a name="MCacheMaxStreamingBuffer" id="MCacheMaxStreamingBuffer">MCacheMaxStreamingBuffer</a> <a name="mcachemaxstreamingbuffer" id="mcachemaxstreamingbuffer">Directive</a></h2>
  112. <table class="directive">
  113. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum amount of a streamed response to buffer in memory
  114. before declaring the response uncacheable</td></tr>
  115. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MCacheMaxStreamingBuffer <var>size_in_bytes</var></code></td></tr>
  116. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MCacheMaxStreamingBuffer the smaller of 100000 or MCacheMaxObjectSize</code></td></tr>
  117. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  118. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
  119. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mem_cache</td></tr>
  120. </table>
  121.     <p>The <code class="directive">MCacheMaxStreamingBuffer</code> directive
  122.     specifies the maximum number of bytes of a streamed response to
  123.     buffer before deciding that the response is too big to cache.
  124.     A streamed response is one in which the entire content is not
  125.     immediately available and in which the <code>Content-Length</code>
  126.     may not be known. Sources of streaming responses include proxied
  127.     responses and the output of CGI scripts. By default, a streamed
  128.     response will <em>not</em> be cached unless it has a
  129.     <code>Content-Length</code> header. The reason for this is to
  130.     avoid using a large amount of memory to buffer a partial response
  131.     that might end up being too large to fit in the cache.
  132.     The <code class="directive">MCacheMaxStreamingBuffer</code> directive allows
  133.     buffering of streamed responses that don't contain a
  134.     <code>Content-Length</code> up to the specified maximum amount of
  135.     space. If the maximum buffer space is reached, the buffered
  136.     content is discarded and the attempt to cache is abandoned.</p>
  137.  
  138.     <div class="note"><h3>Note:</h3>
  139.       <p>Using a nonzero value for <code class="directive">MCacheMaxStreamingBuffer</code> 
  140.       will not delay the transmission of the response to the client.
  141.       As soon as <code class="module"><a href="../mod/mod_mem_cache.html">mod_mem_cache</a></code> copies a block of streamed
  142.       content into a buffer, it sends the block on to the next output
  143.       filter for delivery to the client.</p>
  144.     </div>
  145.  
  146.     <div class="example"><p><code>
  147.       # Enable caching of streamed responses up to 64KB:<br />
  148.       MCacheMaxStreamingBuffer 65536
  149.     </code></p></div>
  150.  
  151. </div>
  152. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  153. <div class="directive-section"><h2><a name="MCacheMinObjectSize" id="MCacheMinObjectSize">MCacheMinObjectSize</a> <a name="mcacheminobjectsize" id="mcacheminobjectsize">Directive</a></h2>
  154. <table class="directive">
  155. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The minimum size (in bytes) of a document to be allowed in the
  156. cache</td></tr>
  157. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MCacheMinObjectSize <var>bytes</var></code></td></tr>
  158. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MCacheMinObjectSize 0</code></td></tr>
  159. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  160. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
  161. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mem_cache</td></tr>
  162. </table>
  163.     <p>The <code class="directive">MCacheMinObjectSize</code> directive sets the
  164.     minimum size in bytes of a document for it to be considered
  165.     cacheable.</p>
  166.  
  167.     <div class="example"><h3>Example</h3><p><code>
  168.       MCacheMinObjectSize 10000
  169.     </code></p></div>
  170.  
  171. </div>
  172. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  173. <div class="directive-section"><h2><a name="MCacheRemovalAlgorithm" id="MCacheRemovalAlgorithm">MCacheRemovalAlgorithm</a> <a name="mcacheremovalalgorithm" id="mcacheremovalalgorithm">Directive</a></h2>
  174. <table class="directive">
  175. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The algorithm used to select documents for removal from the
  176. cache</td></tr>
  177. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MCacheRemovalAlgorithm LRU|GDSF</code></td></tr>
  178. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MCacheRemovalAlgorithm GDSF</code></td></tr>
  179. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  180. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
  181. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mem_cache</td></tr>
  182. </table>
  183.     <p>The <code class="directive">MCacheRemovalAlgorithm</code> directive specifies
  184.     the algorithm used to select documents for removal from the cache.
  185.     Two choices are available:</p>
  186.  
  187.     <dl>
  188.       <dt><code>LRU</code> (Least Recently Used)</dt>
  189.       <dd><code>LRU</code> removes the documents that have not been accessed
  190.       for the longest time.</dd>
  191.  
  192.       <dt><code>GDSF</code> (GreadyDual-Size)</dt>
  193.       <dd><code>GDSF</code> assigns a priority to cached documents based
  194.       on the cost of a cache miss and the size of the document. Documents
  195.       with the lowest priority are removed first.</dd>
  196.     </dl>
  197.  
  198.     <div class="example"><h3>Example</h3><p><code>
  199.       MCacheRemovalAlgorithm GDSF<br />
  200.       MCacheRemovalAlgorithm LRU
  201.     </code></p></div>
  202.  
  203. </div>
  204. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  205. <div class="directive-section"><h2><a name="MCacheSize" id="MCacheSize">MCacheSize</a> <a name="mcachesize" id="mcachesize">Directive</a></h2>
  206. <table class="directive">
  207. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The maximum amount of memory used by the cache in
  208. KBytes</td></tr>
  209. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MCacheSize <var>KBytes</var></code></td></tr>
  210. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MCacheSize 100</code></td></tr>
  211. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  212. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
  213. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mem_cache</td></tr>
  214. </table>
  215.     <p>The <code class="directive">MCacheSize</code> directive sets the maximum
  216.     amount of memory to be used by the cache, in KBytes (1024-byte units).
  217.     If a new object needs to be inserted in the cache and the size of the
  218.     object is greater than the remaining memory, objects will be removed
  219.     until the new object can be cached. The object to be removed is
  220.     selected using the algorithm specified by <code class="directive"><a href="#mcacheremovalalgorithm">MCacheRemovalAlgorithm</a></code>.</p>
  221.  
  222.     <div class="example"><h3>Example</h3><p><code>
  223.       MCacheSize 700000
  224.     </code></p></div>
  225.  
  226.     <div class="note"><h3>Note</h3>
  227.       <p>The <code class="directive">MCacheSize</code> value must be greater than
  228.       the value specified by the <code class="directive"><a href="#mcachemaxobjectsize">MCacheMaxObjectSize</a></code> directive.</p>
  229.     </div>
  230.  
  231. </div>
  232. </div>
  233. <div class="bottomlang">
  234. <p><span>Available Languages: </span><a href="../en/mod/mod_mem_cache.html" title="English"> en </a> |
  235. <a href="../ko/mod/mod_mem_cache.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
  236. </div><div id="footer">
  237. <p class="apache">Copyright 1999-2004 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
  238. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
  239. </body></html>