]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_cache.html.en
Updated doco to conform to Pauls changes in mod_cache.
[apache] / docs / manual / mod / mod_cache.html.en
1 <html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><!--
2         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3               This file is generated from xml source: DO NOT EDIT
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5       --><title>mod_cache - Apache HTTP Server</title><link href="../style/manual.css" type="text/css" rel="stylesheet"></head><body><blockquote><div align="center"><img src="../images/sub.gif" alt="[APACHE DOCUMENTATION]"><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_cache</h1><table cellspacing="1" cellpadding="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap" valign="top"><span class="help">Description:
6                       </span></td><td>Content cache keyed to URIs.</td></tr><tr><td nowrap="nowrap"><a href="module-dict.html#Status" class="help">Status:
7                       </a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="module-dict.html#ModuleIdentifier" class="help">Module&nbsp;Identifier:
8                         </a></td><td>cache_module</td></tr></table></td></tr></table><h2>Summary</h2>
9     <blockquote><table><tr><td bgcolor="#ffe5f5">
10     This module is experimental. Documentation is still under development...
11     </td></tr></table></blockquote>
12     <p>mod_cache implements an RFC 2616 compliant HTTP content
13     cache that can be used to cache either local or proxied content.
14     mod_cache requires the services of one or more storage
15     management modules. Two storage management modules are included in
16     the base Apache distribution:</p>
17     <dl>
18     <dt><em><code><a href="../mod/mod_disk_cache.html">mod_disk_cache</a></code></em></dt>
19     <dd>implements a disk based storage manager for use with <code><a href="../mod/mod_proxy.html">mod_proxy</a></code></dd>
20     <dt><em><code><a href="../mod/mod_mem_cache.html">mod_mem_cache</a></code></em></dt>
21     <dd>implements an in-memory based storage manager. mod_mem_cache
22     can be configured to operate in two modes: caching open file
23     descriptors or caching objects in heap storage. <em><code><a href="../mod/mod_mem_cache.html">mod_mem_cache</a></code></em>
24     is most useful when used to cache locally generated content or to cache 
25     backend server content for mod_proxy configured for ProxyPass (aka <em>reverse proxy</em>)</dd>
26     </dl>
27     <p>Content stored and retrived keyed to the URL. Content with
28     access protections is not cached.</p>
29 <h2>Directives</h2><ul><li><a href="#cachedefaultexpire">CacheDefaultExpire</a></li><li><a href="#cachedisable">CacheDisable</a></li><li><a href="#cacheenable">CacheEnable</a></li><li><a href="#cacheforcecompletion">CacheForceCompletion</a></li><li><a href="#cacheforcecompletion">CacheForceCompletion</a></li><li><a href="#cacheignorecachecontrol">CacheIgnoreCacheControl</a></li><li><a href="#cacheignorenolastmod">CacheIgnoreNoLastMod</a></li><li><a href="#cachelastmodifiedfactor">CacheLastModifiedFactor</a></li><li><a href="#cachemaxexpire">CacheMaxExpire</a></li></ul><h2><a name="related">Related Modules and Directives</a></h2>
30     <table border="1"><tr><td valign="top"><strong>Related Modules</strong><br><br><code><a href="../mod/mod_disk_cache.html">mod_disk_cache</a></code><br><code><a href="../mod/mod_mem_cache.html">mod_mem_cache</a></code><br></td><td valign="top"><strong>Related Directives</strong><br><br><a href="../mod/mod_disk_cache.html#cacheroot" class="directive"><code class="directive">CacheRoot</code></a><br><a href="../mod/mod_disk_cache.html#cachesize" class="directive"><code class="directive">CacheSize</code></a><br><a href="../mod/mod_disk_cache.html#cachegcinterval" class="directive"><code class="directive">CacheGcInterval</code></a><br><a href="../mod/mod_disk_cache.html#cachedirlevels" class="directive"><code class="directive">CacheDirLevels</code></a><br><a href="../mod/mod_disk_cache.html#cachedirlength" class="directive"><code class="directive">CacheDirLength</code></a><br><a href="../mod/mod_disk_cache.html#cacheexpirycheck" class="directive"><code class="directive">CacheExpiryCheck</code></a><br><a href="../mod/mod_disk_cache.html#cacheminfilesize" class="directive"><code class="directive">CacheMinFileSize</code></a><br><a href="../mod/mod_disk_cache.html#cachemaxfilesize" class="directive"><code class="directive">CacheMaxFileSize</code></a><br><a href="../mod/mod_disk_cache.html#cachetimemargin" class="directive"><code class="directive">CacheTimeMargin</code></a><br><a href="../mod/mod_disk_cache.html#cachegcdaily" class="directive"><code class="directive">CacheGcDaily</code></a><br><a href="../mod/mod_disk_cache.html#cachegcunused" class="directive"><code class="directive">CacheGcUnused</code></a><br><a href="../mod/mod_disk_cache.html#cachegcclean" class="directive"><code class="directive">CacheGcClean</code></a><br><a href="../mod/mod_disk_cache.html#cachegcmemusage" class="directive"><code class="directive">CacheGcMemUsage</code></a><br><a href="../mod/mod_mem_cache.html#mcachesize" class="directive"><code class="directive">MCacheSize</code></a><br><a href="../mod/mod_mem_cache.html#mcachemaxobjectcount" class="directive"><code class="directive">MCacheMaxObjectCount</code></a><br><a href="../mod/mod_mem_cache.html#mcacheminobjectsize" class="directive"><code class="directive">MCacheMinObjectSize</code></a><br><a href="../mod/mod_mem_cache.html#mcachemaxobjectsize" class="directive"><code class="directive">MCacheMaxObjectSize</code></a><br><a href="../mod/mod_mem_cache.html#mcacheremovalalgorithm" class="directive"><code class="directive">MCacheRemovalAlgorithm</code></a><br></td></tr></table>
31 <h2>Sample Configuration</h2>
32 <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><p align="center"><strong>Sample httpd.conf</strong></p><code>
33 # <br>
34 # Sample Cache Configuration <br>
35 # <br>
36 LoadModule cache_module modules/mod_cache.so <br>
37 &lt;IfModule mod_cache.c&gt; <br>
38 <br>
39 #LoadModule disk_cache_module modules/mod_disk_cache.so <br>
40    &lt;IfModule mod_disk_cache.c&gt; <br>
41       CacheRoot c:/cacheroot <br>
42       CacheSize 256 <br> 
43       CacheEnable disk  / <br>
44       CacheDirLevels 5 <br>
45       CacheDirLength 3 <br>
46    &lt;/IfModule&gt; <br>
47 <p></p>
48    LoadModule mem_cache_module modules/mod_mem_cache.so <br>
49    &lt;IfModule mod_mem_cache.c&gt; <br>
50       MCacheEnable mem  / <br>
51       MCacheSize 4096 <br>
52       MCacheMaxObjectCount 100 <br>
53       MCacheMinObjectSize 1 <br>
54       MCacheMaxObjectSize 2048 <br>
55    &lt;/IfModule&gt; <br>
56 <p></p>
57 &lt;/IfModule&gt; <br>
58 </code></td></tr></table></blockquote>
59 <hr><h2><a name="CacheDefaultExpire">CacheDefaultExpire</a> <a name="cachedefaultexpire">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: 
60                   </strong></td><td></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:
61                   </a></td><td>CacheDefaultExpire <em>seconds</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default: 
62                     </a></td><td><code>CacheDefaultExpire 3600 (one hour)</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:
63                   </a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:
64                   </a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:
65                   </a></td><td>mod_cache</td></tr></table></td></tr></table>
66     <p>The default time in seconds to cache a document if the page does not have
67     an expiry date in the <em>Expires</em> field.</p>
68     <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
69     CacheDefaultExpire 86400
70     </code></td></tr></table></blockquote>
71 <hr><h2><a name="CacheDisable">CacheDisable</a> <a name="cachedisable">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: 
72                   </strong></td><td>Disable caching of specified URLs by specified storage manager</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:
73                   </a></td><td>CacheDisable <em>cache_type </em> <em> url-string</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:
74                   </a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:
75                   </a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:
76                   </a></td><td>mod_cache</td></tr></table></td></tr></table>
77     <p>The <code class="directive">CacheDisable</code> directive instructs
78     mod_cache to <em>not</em> cache urls at or above <em>url-string</em>.</p>
79
80 <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><p align="center"><strong>Example</strong></p><code>
81   CacheDisable disk /local_files
82 </code></td></tr></table></blockquote>
83 <hr><h2><a name="CacheEnable">CacheEnable</a> <a name="cacheenable">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: 
84                   </strong></td><td>Enable caching specified URLs in a specified storage manager</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:
85                   </a></td><td>CacheEnable <em>cache_type </em><em> url-string</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:
86                   </a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:
87                   </a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:
88                   </a></td><td>mod_cache</td></tr></table></td></tr></table>
89     <p>The <code class="directive">CacheEnable</code> directive instructs
90     mod_cache to cache urls at or below <em>url-string</em>.  
91     The cache store is specified with the <em>cache_type</em> argument.
92     <em>cache_type </em> <em> mem</em> instructs mod_cache to use the
93     in-memory cache storage manager implemented by <em>mod_mem_cache</em>. 
94     <em>cache_type </em> <em> disk</em> instructs mod_cache to use the
95     cache storage manager implemented by <em>mod_disk_cache </em>. </p>
96
97 <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
98   CacheEnable  disk  / <br>
99   CacheEnable  mem   /manual <br>
100   CacheEnable  fd    /images <br>
101 </code></td></tr></table></blockquote>
102 <hr><h2><a name="CacheForceCompletion">CacheForceCompletion</a> <a name="cacheforcecompletion">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: 
103                   </strong></td><td>Percentage of download to arrive for the cache to force complete transfert</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:
104                   </a></td><td>CacheLastModifiedFactor <em>Percentage</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default: 
105                     </a></td><td><code>CacheLastModifiedFactor 60</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:
106                   </a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:
107                   </a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:
108                   </a></td><td>mod_cache</td></tr></table></td></tr></table>
109     <p>Percentage of download to arrive for the cache to force complete transfert.</p>
110
111     <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
112     CacheForceCompletion  
113     </code></td></tr></table></blockquote>
114 <blockquote><table><tr><td bgcolor="#ffe5f5">
115 This feature is currently <em>not</em> implemented.
116 </td></tr></table></blockquote>
117  <hr><h2><a name="CacheForceCompletion">CacheForceCompletion</a> <a name="cacheforcecompletion">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: 
118                   </strong></td><td>Percentage of download to arrive for the cache to force complete transfert</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:
119                   </a></td><td>CacheLastModifiedFactor <em>Percentage</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default: 
120                     </a></td><td><code>CacheLastModifiedFactor 60</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:
121                   </a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:
122                   </a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:
123                   </a></td><td>mod_cache</td></tr></table></td></tr></table>
124     <p>Percentage of download to arrive for the cache to force complete transfert.</p>
125
126     <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
127     CacheForceCompletion  
128     </code></td></tr></table></blockquote>
129 <blockquote><table><tr><td bgcolor="#ffe5f5">
130 This feature is currently <em>not</em> implemented.
131 </td></tr></table></blockquote>
132 <hr><h2><a name="CacheIgnoreCacheControl">CacheIgnoreCacheControl</a> <a name="cacheignorecachecontrol">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: 
133                   </strong></td><td>Ignore requests from the client for uncached content</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:
134                   </a></td><td>CacheIgnoreCacheControl</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:
135                   </a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:
136                   </a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:
137                   </a></td><td>mod_cache</td></tr></table></td></tr></table>
138     <p>Ignore requests from the client for uncached content</p>
139
140     <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
141     CacheIgnoreNoLastMod 
142     </code></td></tr></table></blockquote>
143 <hr><h2><a name="CacheIgnoreNoLastMod">CacheIgnoreNoLastMod</a> <a name="cacheignorenolastmod">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: 
144                   </strong></td><td>Ignore responses where there is no Last Modified Header</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:
145                   </a></td><td>CacheIgnoreNoLastMod</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:
146                   </a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:
147                   </a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:
148                   </a></td><td>mod_cache</td></tr></table></td></tr></table>
149     <p>Ignore responses where there is no Last Modified Header</p>
150
151     <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
152     CacheIgnoreNoLastMod 
153     </code></td></tr></table></blockquote>
154 <hr><h2><a name="CacheLastModifiedFactor">CacheLastModifiedFactor</a> <a name="cachelastmodifiedfactor">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: 
155                   </strong></td><td>The factor used to estimate the Expires date from the LastModified date</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:
156                   </a></td><td>CacheLastModifiedFactor <em>float</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default: 
157                     </a></td><td><code>CacheLastModifiedFactor 0.1</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:
158                   </a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:
159                   </a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:
160                   </a></td><td>mod_cache</td></tr></table></td></tr></table>
161     <p>The factor used to estimate the Expires date from the LastModified date.</p>
162
163     <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
164     CacheLastModifiedFactor  
165     </code></td></tr></table></blockquote>
166 <hr><h2><a name="CacheMaxExpire">CacheMaxExpire</a> <a name="cachemaxexpire">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: 
167                   </strong></td><td>The maximum time in seconds to cache a document</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:
168                   </a></td><td>CacheMaxExpire <em>seconds</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default: 
169                     </a></td><td><code>CacheMaxExpire 86400 (one day)</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:
170                   </a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:
171                   </a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:
172                   </a></td><td>mod_cache</td></tr></table></td></tr></table>
173     <p>The maximum time in seconds to cache a document. The <code class="directive">CacheMaxExpire</code>
174     takes precedence over the <em>Expire</em> field from the header.</p>
175     <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
176     CacheMaxExpire 604800
177     </code></td></tr></table></blockquote>
178 <hr></blockquote><h3 align="center">Apache HTTP Server Version 2.0</h3><a href="./"><img src="../images/index.gif" alt="Index"></a><a href="../"><img src="../images/home.gif" alt="Home"></a></body></html>