upload apache
[bottlenecks.git] / rubbos / app / apache2 / manual / mod / mod_cache.html.en
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_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="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.0</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_cache</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../en/mod/mod_cache.html" title="English">&nbsp;en&nbsp;</a> |
25 <a href="../ko/mod/mod_cache.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</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>cache_module</td></tr>
30 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_cache.c</td></tr></table>
31 <h3>Summary</h3>
32
33     <div class="warning">
34       This module is experimental. Documentation is still under development...
35     </div>
36
37     <p><code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> implements an <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616</a> compliant HTTP
38     content cache that can be used to cache either local or proxied content.
39     <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> requires the services of one or more storage
40     management modules. Two storage management modules are included in
41     the base Apache distribution:</p>
42     <dl>
43     <dt><code class="module"><a href="../mod/mod_disk_cache.html">mod_disk_cache</a></code></dt>
44     <dd>implements a disk based storage manager.</dd>
45
46     <dt><code class="module"><a href="../mod/mod_mem_cache.html">mod_mem_cache</a></code></dt>
47     <dd>implements a memory based storage manager. 
48     <code class="module"><a href="../mod/mod_mem_cache.html">mod_mem_cache</a></code> can be configured to operate in two
49     modes: caching open file descriptors or caching objects in heap storage.
50     <code class="module"><a href="../mod/mod_mem_cache.html">mod_mem_cache</a></code> can be used to cache locally generated content
51     or to cache backend server content for <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> when
52     configured using <code class="directive"><a href="../mod/mod_proxy.html#proxypass">ProxyPass</a></code>
53     (aka <dfn>reverse proxy</dfn>)</dd>
54     </dl>
55
56     <p>Content is stored in and retrieved from the cache using URI based keys. Content with
57     access protection is not cached.</p>
58 </div>
59 <div id="quickview"><h3 class="directives">Directives</h3>
60 <ul id="toc">
61 <li><img alt="" src="../images/down.gif" /> <a href="#cachedefaultexpire">CacheDefaultExpire</a></li>
62 <li><img alt="" src="../images/down.gif" /> <a href="#cachedisable">CacheDisable</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#cacheenable">CacheEnable</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#cacheforcecompletion">CacheForceCompletion</a></li>
65 <li><img alt="" src="../images/down.gif" /> <a href="#cacheignorecachecontrol">CacheIgnoreCacheControl</a></li>
66 <li><img alt="" src="../images/down.gif" /> <a href="#cacheignoreheaders">CacheIgnoreHeaders</a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#cacheignorenolastmod">CacheIgnoreNoLastMod</a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#cachelastmodifiedfactor">CacheLastModifiedFactor</a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#cachemaxexpire">CacheMaxExpire</a></li>
70 </ul>
71 <h3>Topics</h3>
72 <ul id="topics">
73 <li><img alt="" src="../images/down.gif" /> <a href="#related">Related Modules and Directives</a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#sampleconf">Sample Configuration</a></li>
75 </ul></div>
76 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
77 <div class="section">
78 <h2><a name="related" id="related">Related Modules and Directives</a></h2>
79     <table class="related"><tr><th>Related Modules</th><th>Related Directives</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#cachesize">CacheSize</a></code></li><li><code class="directive"><a href="../mod/mod_disk_cache.html#cachegcinterval">CacheGcInterval</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#cacheexpirycheck">CacheExpiryCheck</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_disk_cache.html#cachetimemargin">CacheTimeMargin</a></code></li><li><code class="directive"><a href="../mod/mod_disk_cache.html#cachegcdaily">CacheGcDaily</a></code></li><li><code class="directive"><a href="../mod/mod_disk_cache.html#cachegcunused">CacheGcUnused</a></code></li><li><code class="directive"><a href="../mod/mod_disk_cache.html#cachegcclean">CacheGcClean</a></code></li><li><code class="directive"><a href="../mod/mod_disk_cache.html#cachegcmemusage">CacheGcMemUsage</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>
80 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
81 <div class="section">
82 <h2><a name="sampleconf" id="sampleconf">Sample Configuration</a></h2>
83     <div class="example"><h3>Sample httpd.conf</h3><p><code>
84       #<br />
85       # Sample Cache Configuration<br />
86       #<br />
87       LoadModule cache_module modules/mod_cache.so<br />
88       <br />
89       &lt;IfModule mod_cache.c&gt;<br />
90       <span class="indent">
91         #LoadModule disk_cache_module modules/mod_disk_cache.so<br />
92         &lt;IfModule mod_disk_cache.c&gt;<br />
93         <span class="indent">
94           CacheRoot c:/cacheroot<br />
95           CacheSize 256<br />
96           CacheEnable disk  /<br />
97           CacheDirLevels 5<br />
98           CacheDirLength 3<br />
99         </span>
100         &lt;/IfModule&gt; <br />
101         <br />
102         LoadModule mem_cache_module modules/mod_mem_cache.so<br />
103         &lt;IfModule mod_mem_cache.c&gt;<br />
104         <span class="indent">
105           CacheEnable mem  /<br />
106           MCacheSize 4096<br />
107           MCacheMaxObjectCount 100<br />
108           MCacheMinObjectSize 1<br />
109           MCacheMaxObjectSize 2048<br />
110         </span>
111         &lt;/IfModule&gt;<br />
112       </span>
113       &lt;/IfModule&gt;
114     </code></p></div>
115 </div>
116 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
117 <div class="directive-section"><h2><a name="CacheDefaultExpire" id="CacheDefaultExpire">CacheDefaultExpire</a> <a name="cachedefaultexpire" id="cachedefaultexpire">Directive</a></h2>
118 <table class="directive">
119 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The default duration to cache a document when no expiry date is specified.</td></tr>
120 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheDefaultExpire <var>seconds</var></code></td></tr>
121 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheDefaultExpire 3600 (one hour)</code></td></tr>
122 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
123 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
124 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
125 </table>
126     <p>The <code class="directive">CacheDefaultExpire</code> directive specifies a default time,
127     in seconds, to cache a document if neither an expiry date nor last-modified date are provided
128     with the document. The value specified with the <code class="directive">CacheMaxExpire</code>
129     directive does <em>not</em> override this setting.</p>
130
131     <div class="example"><p><code>
132       CacheDefaultExpire 86400
133     </code></p></div>
134
135 </div>
136 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
137 <div class="directive-section"><h2><a name="CacheDisable" id="CacheDisable">CacheDisable</a> <a name="cachedisable" id="cachedisable">Directive</a></h2>
138 <table class="directive">
139 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Disable caching of specified URLs</td></tr>
140 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheDisable <var> url-string</var></code></td></tr>
141 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
142 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
143 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
144 </table>
145     <p>The <code class="directive">CacheDisable</code> directive instructs
146     <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> to <em>not</em> cache urls at or below
147     <var>url-string</var>.</p>
148
149     <div class="example"><h3>Example</h3><p><code>
150       CacheDisable /local_files
151     </code></p></div>
152
153 </div>
154 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
155 <div class="directive-section"><h2><a name="CacheEnable" id="CacheEnable">CacheEnable</a> <a name="cacheenable" id="cacheenable">Directive</a></h2>
156 <table class="directive">
157 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable caching of specified URLs using a specified storage
158 manager</td></tr>
159 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheEnable <var>cache_type</var> <var>url-string</var></code></td></tr>
160 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
161 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
162 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
163 </table>
164     <p>The <code class="directive">CacheEnable</code> directive instructs
165     <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> to cache urls at or below
166     <var>url-string</var>. The cache storage manager is specified with the
167     <var>cache_type</var> argument. <var>cache_type</var> <code> mem</code>
168     instructs <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> to use the memory based storage
169     manager implemented by <code class="module"><a href="../mod/mod_mem_cache.html">mod_mem_cache</a></code>. 
170     <var>cache_type</var> <code>disk</code> instructs
171     <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> to use the disk based storage manager
172     implemented by <code class="module"><a href="../mod/mod_disk_cache.html">mod_disk_cache</a></code>.
173     <var>cache_type</var> <code>fd</code> instructs
174     <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> to use the file descriptor cache implemented
175     by <code class="module"><a href="../mod/mod_mem_cache.html">mod_mem_cache</a></code>.</p>
176     <p>In the event that the URL space overlaps between different
177     <code class="directive">CacheEnable</code> directives (as in the example below),
178     each possible storage manager will be run until the first one that
179     actually processes the request. The order in which the storage managers are
180     run is determined by the order of the <code class="directive">CacheEnable</code>
181     directives in the configuration file.</p>
182
183     <div class="example"><p><code>
184       CacheEnable  mem   /manual<br />
185       CacheEnable  fd    /images<br />
186       CacheEnable  disk  /<br />
187     </code></p></div>
188
189 </div>
190 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
191 <div class="directive-section"><h2><a name="CacheForceCompletion" id="CacheForceCompletion">CacheForceCompletion</a> <a name="cacheforcecompletion" id="cacheforcecompletion">Directive</a></h2>
192 <table class="directive">
193 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Percentage of document served, after which the server
194 will complete caching the file even if the request is cancelled.</td></tr>
195 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheForceCompletion <var>Percentage</var></code></td></tr>
196 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheForceCompletion 60</code></td></tr>
197 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
198 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
199 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
200 </table>
201     <p>Ordinarily, if a request is cancelled while the response is being
202     cached and delivered to the client the processing of the response will
203     stop and the cache entry will be removed. The
204     <code class="directive">CacheForceCompletion</code> directive specifies a
205     threshold beyond which the document will continue to be cached to
206     completion, even if the request is cancelled.</p>
207
208     <p>The threshold is a percentage specified as a value between
209     <code>1</code> and <code>100</code>. A value of <code>0</code>
210     specifies that the default be used. A value of <code>100</code>
211     will only cache documents that are served in their entirety. A value
212     between 60 and 90 is recommended.</p>
213
214     <div class="example"><p><code>
215       CacheForceCompletion 80
216     </code></p></div>
217
218     <div class="warning"><h3>Note:</h3>
219       This feature is currently <em>not</em> implemented.
220     </div>
221
222 </div>
223 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
224 <div class="directive-section"><h2><a name="CacheIgnoreCacheControl" id="CacheIgnoreCacheControl">CacheIgnoreCacheControl</a> <a name="cacheignorecachecontrol" id="cacheignorecachecontrol">Directive</a></h2>
225 <table class="directive">
226 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Ignore the fact that the client requested the content not be
227 cached.</td></tr>
228 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheIgnoreCacheControl On|Off</code></td></tr>
229 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheIgnoreCacheControl Off</code></td></tr>
230 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
231 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
232 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
233 </table>
234     <p>Ordinarily, documents with no-cache or no-store header values will not be stored in the cache.
235     The <code class="directive">CacheIgnoreCacheControl</code> directive allows this behavior to be overridden.
236     <code class="directive">CacheIgnoreCacheControl</code> On tells the server to attempt to cache the document
237     even if it contains no-cache or no-store header values. Documents requiring authorization will
238     <em>never</em> be cached.</p>
239
240     <div class="example"><p><code>
241       CacheIgnoreCacheControl On
242     </code></p></div>
243
244 </div>
245 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
246 <div class="directive-section"><h2><a name="CacheIgnoreHeaders" id="CacheIgnoreHeaders">CacheIgnoreHeaders</a> <a name="cacheignoreheaders" id="cacheignoreheaders">Directive</a></h2>
247 <table class="directive">
248 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Do not store the given HTTP header(s) in the cache.
249 </td></tr>
250 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheIgnoreHeaders <var>header-string</var> [<var>header-string</var>] ...</code></td></tr>
251 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheIgnoreHeaders None</code></td></tr>
252 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
253 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
254 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
255 </table>
256     <p>According to RFC 2616, hop-by-hop HTTP headers are not stored in
257     the cache.  The following HTTP headers are hop-by-hop headers and thus
258     do not get stored in the cache in <em>any</em> case regardless of the
259     setting of <code class="directive">CacheIgnoreHeaders</code>:</p>
260
261     <ul>
262       <li><code>Connection</code></li>
263       <li><code>Keep-Alive</code></li>
264       <li><code>Proxy-Authenticate</code></li>
265       <li><code>Proxy-Authorization</code></li>
266       <li><code>TE</code></li>
267       <li><code>Trailers</code></li>
268       <li><code>Transfer-Encoding</code></li>
269       <li><code>Upgrade</code></li>
270     </ul>
271
272     <p><code class="directive">CacheIgnoreHeaders</code> specifies additional HTTP
273     headers that should not to be stored in the cache.  For example, it makes
274     sense in some cases to prevent cookies from being stored in the cache.</p>
275
276     <p><code class="directive">CacheIgnoreHeaders</code> takes a space separated list
277     of HTTP headers that should not be stored in the cache. If only hop-by-hop
278     headers not should be stored in the cache (the RFC 2616 compliant
279     behaviour), <code class="directive">CacheIgnoreHeaders</code> can be set to
280     <code>None</code>.</p>
281
282     <div class="example"><h3>Example 1</h3><p><code>
283       CacheIgnoreHeaders Set-Cookie
284     </code></p></div>
285
286     <div class="example"><h3>Example 2</h3><p><code>
287       CacheIgnoreHeaders None
288     </code></p></div>
289
290     <div class="warning"><h3>Warning:</h3>
291       If headers like <code>Expires</code> which are needed for proper cache
292       management are not stored due to a
293       <code class="directive">CacheIgnoreHeaders</code> setting, the behaviour of
294       mod_cache is undefined.
295     </div>
296
297 </div>
298 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
299 <div class="directive-section"><h2><a name="CacheIgnoreNoLastMod" id="CacheIgnoreNoLastMod">CacheIgnoreNoLastMod</a> <a name="cacheignorenolastmod" id="cacheignorenolastmod">Directive</a></h2>
300 <table class="directive">
301 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Ignore the fact that a response has no Last Modified
302 header.</td></tr>
303 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheIgnoreNoLastMod On|Off</code></td></tr>
304 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheIgnoreNoLastMod Off</code></td></tr>
305 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
306 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
307 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
308 </table>
309     <p>Ordinarily, documents without a last-modified date are not cached.
310     Under some circumstances the last-modified date is removed (during
311     <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> processing for example) or not provided
312     at all. The <code class="directive">CacheIgnoreNoLastMod</code> directive
313     provides a way to specify that documents without last-modified dates
314     should be considered for caching, even without a last-modified date.
315     If neither a last-modified date nor an expiry date are provided with
316     the document then the value specified by the
317     <code class="directive">CacheDefaultExpire</code> directive will be used to
318     generate an expiration date.</p>
319
320     <div class="example"><p><code>
321       CacheIgnoreNoLastMod On
322     </code></p></div>
323
324 </div>
325 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
326 <div class="directive-section"><h2><a name="CacheLastModifiedFactor" id="CacheLastModifiedFactor">CacheLastModifiedFactor</a> <a name="cachelastmodifiedfactor" id="cachelastmodifiedfactor">Directive</a></h2>
327 <table class="directive">
328 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The factor used to compute an expiry date based on the
329 LastModified date.</td></tr>
330 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheLastModifiedFactor <var>float</var></code></td></tr>
331 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheLastModifiedFactor 0.1</code></td></tr>
332 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
333 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
334 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
335 </table>
336     <p>In the event that a document does not provide an expiry date but does
337     provide a last-modified date, an expiry date can be calculated based on
338     the time since the document was last modified. The
339     <code class="directive">CacheLastModifiedFactor</code> directive specifies a
340     <var>factor</var> to be used in the generation of this expiry date
341     according to the following formula:
342
343     <code>expiry-period = time-since-last-modified-date * <var>factor</var>
344     expiry-date = current-date + expiry-period</code>
345
346     For example, if the document was last modified 10 hours ago, and
347     <var>factor</var> is 0.1 then the expiry-period will be set to
348     10*0.1 = 1 hour. If the current time was 3:00pm then the computed
349     expiry-date would be 3:00pm + 1hour = 4:00pm.
350
351     If the expiry-period would be longer than that set by
352     <code class="directive">CacheMaxExpire</code>, then the latter takes
353     precedence.</p>
354
355     <div class="example"><p><code>
356       CacheLastModifiedFactor 0.5
357     </code></p></div>
358
359 </div>
360 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
361 <div class="directive-section"><h2><a name="CacheMaxExpire" id="CacheMaxExpire">CacheMaxExpire</a> <a name="cachemaxexpire" id="cachemaxexpire">Directive</a></h2>
362 <table class="directive">
363 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The maximum time in seconds to cache a document</td></tr>
364 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheMaxExpire <var>seconds</var></code></td></tr>
365 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheMaxExpire 86400 (one day)</code></td></tr>
366 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
367 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
368 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
369 </table>
370     <p>The <code class="directive">CacheMaxExpire</code> directive specifies the maximum number of
371     seconds for which cachable HTTP documents will be retained without checking the origin
372     server. Thus, documents will be out of date at most this number of seconds. This maximum
373     value is enforced even if an expiry date was supplied with the document.</p>
374
375     <div class="example"><p><code>
376       CacheMaxExpire 604800
377     </code></p></div>
378
379 </div>
380 </div>
381 <div class="bottomlang">
382 <p><span>Available Languages: </span><a href="../en/mod/mod_cache.html" title="English">&nbsp;en&nbsp;</a> |
383 <a href="../ko/mod/mod_cache.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
384 </div><div id="footer">
385 <p class="apache">Copyright 2009 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>
386 <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>
387 </body></html>