]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_cache.xml
Updated XML plus transformations. Whhups, this is a big one :-)
[apache] / docs / manual / mod / mod_cache.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <modulesynopsis>
5
6 <name>mod_cache</name>
7 <description>Content cache keyed to URIs.</description>
8 <status>Experimental</status>
9 <sourcefile>mod_cache.c</sourcefile>
10 <identifier>cache_module</identifier>
11
12 <summary>
13     <note type="warning">
14     This module is experimental. Documentation is still under development...
15     </note>
16     <p>mod_cache implements an RFC 2616 compliant HTTP content
17     cache that can be used to cache either local or proxied content.
18     mod_cache requires the services of one or more storage
19     management modules. Two storage management modules are included in
20     the base Apache distribution:</p>
21     <dl>
22     <dt><module>mod_disk_cache</module></dt>
23     <dd>implements a disk based storage manager for use with <module>mod_proxy</module></dd>
24     <dt><module>mod_mem_cache</module></dt>
25     <dd>implements an in-memory based storage manager. mod_mem_cache
26     can be configured to operate in two modes: caching open file
27     descriptors or caching objects in heap storage. <em><module>mod_mem_cache</module></em>
28     is most useful when used to cache locally generated content or to cache 
29     backend server content for mod_proxy configured for ProxyPass (aka <em>reverse proxy</em>)</dd>
30     </dl>
31     <p>Content stored and retrived keyed to the URL. Content with
32     access protections is not cached.</p>
33 </summary>
34
35 <section id="related"><title>Related Modules and Directives</title>
36     <related>
37       <modulelist>
38         <module>mod_disk_cache</module>
39         <module>mod_mem_cache</module>
40       </modulelist>
41       <directivelist>
42         <directive module="mod_disk_cache">CacheRoot</directive>
43         <directive module="mod_disk_cache">CacheSize</directive>
44         <directive module="mod_disk_cache">CacheGcInterval</directive>
45         <directive module="mod_disk_cache">CacheDirLevels</directive>
46         <directive module="mod_disk_cache">CacheDirLength</directive>
47         <directive module="mod_disk_cache">CacheExpiryCheck</directive>
48         <directive module="mod_disk_cache">CacheMinFileSize</directive>
49         <directive module="mod_disk_cache">CacheMaxFileSize</directive>
50         <directive module="mod_disk_cache">CacheTimeMargin</directive>
51         <directive module="mod_disk_cache">CacheGcDaily</directive>
52         <directive module="mod_disk_cache">CacheGcUnused</directive>
53         <directive module="mod_disk_cache">CacheGcClean</directive>
54         <directive module="mod_disk_cache">CacheGcMemUsage</directive>
55         <directive module="mod_mem_cache">MCacheSize</directive>
56         <directive module="mod_mem_cache">MCacheMaxObjectCount</directive>
57         <directive module="mod_mem_cache">MCacheMinObjectSize</directive>
58         <directive module="mod_mem_cache">MCacheMaxObjectSize</directive>
59         <directive module="mod_mem_cache">MCacheRemovalAlgorithm</directive>
60       </directivelist>
61     </related>
62 </section>
63
64 <section><title>Sample Configuration</title>
65 <example><title>Sample httpd.conf</title>
66 # <br />
67 # Sample Cache Configuration <br />
68 # <br />
69 LoadModule cache_module modules/mod_cache.so <br />
70 &lt;IfModule mod_cache.c&gt; <br />
71 <br />
72 #LoadModule disk_cache_module modules/mod_disk_cache.so <br />
73    &lt;IfModule mod_disk_cache.c&gt; <br />
74       CacheRoot c:/cacheroot <br />
75       CacheSize 256 <br /> 
76       CacheEnable disk  / <br />
77       CacheDirLevels 5 <br />
78       CacheDirLength 3 <br />
79    &lt;/IfModule&gt; <br />
80 <br />
81    LoadModule mem_cache_module modules/mod_mem_cache.so <br />
82    &lt;IfModule mod_mem_cache.c&gt; <br />
83       MCacheEnable mem  / <br />
84       MCacheSize 4096 <br />
85       MCacheMaxObjectCount 100 <br />
86       MCacheMinObjectSize 1 <br />
87       MCacheMaxObjectSize 2048 <br />
88    &lt;/IfModule&gt; <br />
89 <br />
90 &lt;/IfModule&gt; <br />
91 </example>
92 </section>
93
94 <directivesynopsis>
95 <name>CacheEnable</name>
96 <description>Enable caching specified URLs in a specified storage manager</description>
97 <syntax>CacheEnable <em>cache_type </em><em> url-string</em></syntax>
98 <contextlist><context>server config</context></contextlist>
99
100 <usage>
101     <p>The <directive>CacheEnable</directive> directive instructs
102     mod_cache to cache urls at or below <em>url-string</em>.  
103     The cache store is specified with the <em>cache_type</em> argument.
104     <em>cache_type </em> <em> mem</em> instructs mod_cache to use the
105     in-memory cache storage manager implemented by <em>mod_mem_cache</em>. 
106     <em>cache_type </em> <em> disk</em> instructs mod_cache to use the
107     cache storage manager implemented by <em>mod_disk_cache </em>. </p>
108
109 <example>
110   CacheEnable  disk  / <br />
111   CacheEnable  mem   /manual <br />
112   CacheEnable  fd    /images <br />
113 </example>
114 </usage>
115
116 </directivesynopsis>
117
118 <directivesynopsis>
119 <name>CacheDisable</name>
120 <description>Disable caching of specified URLs by specified storage manager</description>
121 <syntax>CacheDisable <em>cache_type </em> <em> url-string</em></syntax>
122 <contextlist><context>server config</context></contextlist>
123
124 <usage>
125     <p>The <directive>CacheDisable</directive> directive instructs
126     mod_cache to <em>not</em> cache urls at or above <em>url-string</em>.</p>
127
128 <example><title>Example</title>
129   CacheDisable disk /local_files
130 </example>
131 </usage>
132
133 </directivesynopsis>
134 <directivesynopsis>
135 <name>CacheMaxExpire</name>
136 <description>The maximum time in seconds to cache a document</description>
137 <syntax>CacheMaxExpire <em>seconds</em></syntax>
138 <default>CacheMaxExpire 86400 (one day)</default>
139 <contextlist><context>server config</context></contextlist>
140
141 <usage>
142     <p>The maximum time in seconds to cache a document. The <directive>CacheMaxExpire</directive>
143     takes precedence over the <em>Expire</em> field from the header.</p>
144     <example>
145     CacheMaxExpire 604800
146     </example>
147 </usage>
148 </directivesynopsis>
149 <directivesynopsis>
150 <name>CacheDefaultExpire</name>
151 <syntax>CacheDefaultExpire <em>seconds</em></syntax>
152 <default>CacheDefaultExpire 3600 (one hour)</default>
153 <contextlist><context>server config</context></contextlist>
154
155 <usage>
156     <p>The default time in seconds to cache a document if the page does not have
157     an expiry date in the <em>Expires</em> field.</p>
158     <example>
159     CacheDefaultExpire 86400
160     </example>
161 </usage>
162 </directivesynopsis>
163
164 <directivesynopsis>
165 <name>CacheIgnoreNoLastMod</name>
166 <description>Ignore responses where there is no Last Modified Header</description>
167 <syntax>CacheIgnoreNoLastMod</syntax>
168 <contextlist><context>server config</context></contextlist>
169
170 <usage>
171     <p>Ignore responses where there is no Last Modified Header</p>
172
173     <example>
174     CacheIgnoreNoLastMod 
175     </example>
176 </usage>
177 </directivesynopsis>
178
179 <directivesynopsis>
180 <name>CacheIgnoreCacheControl</name>
181 <description>Ignore requests from the client for uncached content</description>
182 <syntax>CacheIgnoreCacheControl</syntax>
183 <contextlist><context>server config</context></contextlist>
184
185 <usage>
186     <p>Ignore requests from the client for uncached content</p>
187
188     <example>
189     CacheIgnoreNoLastMod 
190     </example>
191 </usage>
192 </directivesynopsis>
193
194 <directivesynopsis>
195 <name>CacheLastModifiedFactor</name>
196 <description>The factor used to estimate the Expires date from the LastModified date</description>
197 <syntax>CacheLastModifiedFactor <em>float</em></syntax>
198 <default>CacheLastModifiedFactor 0.1</default>
199 <contextlist><context>server config</context></contextlist>
200
201 <usage>
202     <p>The factor used to estimate the Expires date from the LastModified date.</p>
203
204     <example>
205     CacheLastModifiedFactor 0.5
206     </example>
207 </usage>
208 </directivesynopsis>
209
210 <directivesynopsis>
211 <name>CacheForceCompletion</name>
212 <description>Percentage of download to arrive for the cache to force complete transfert</description>
213 <syntax>CacheForceCompletion <em>Percentage</em></syntax>
214 <default>CacheForceCompletion 60</default>
215 <contextlist><context>server config</context></contextlist>
216
217 <usage>
218     <p>Percentage of download to arrive for the cache to force complete transfert.</p>
219
220     <example>
221     CacheForceCompletion 80
222     </example>
223 <note type="warning">
224 This feature is currently <em>not</em> implemented.
225 </note>
226  </usage>
227  </directivesynopsis>
228
229 <directivesynopsis>
230 <name>CacheMaxStreamingBuffer</name>
231 <description>Maximum amount of a streamed response to buffer in memory before declaring the response uncacheable</description>
232 <syntax>CacheMaxStreamingBuffer <em>size_in_bytes</em></syntax>
233 <default>CacheMaxStreamingBuffer 0</default>
234 <contextlist><context>server config</context></contextlist>
235
236 <usage>
237     <p>Maximum number of bytes of a streamed response (i.e., a response where the entire content is not available all at once, such as a proxy or CGI response) to buffer before deciding if the response is cacheable.  By default, a streamed response will <em>not</em> be cached unless it has a Content-Length header.  The reason for this is to avoid using a large amount of memory to buffer a partial response that might end up being too large to fit in the cache anyway.  To enable caching of streamed responses, use CacheMaxStreamingBuffer to specify the maximum amount of buffer space to use per request.</p>
238     <p>Note: Using a nonzero value for CacheMaxStreamingBuffer will not delay the transmission of the response to the client.  As soon as mod_cache copies a
239     block of streamed content into a buffer, it sends the block on to the next
240     output filter for delivery to the client.</p>
241
242     <example>
243     # Enable caching of streamed responses up to 64KB:
244     CacheMaxStreamingBuffer  65536
245     </example>
246 </usage>
247 </directivesynopsis>
248
249 </modulesynopsis>