mod_cache.html.en revision f21bea4c0f58e17aa1d9a0fac2c219852f89944a
842ae4bd224140319ae7feec1872b93dfd491143fielding<?xml version="1.0" encoding="ISO-8859-1"?>
842ae4bd224140319ae7feec1872b93dfd491143fielding<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
842ae4bd224140319ae7feec1872b93dfd491143fielding<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
842ae4bd224140319ae7feec1872b93dfd491143fielding XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
842ae4bd224140319ae7feec1872b93dfd491143fielding This file is generated from xml source: DO NOT EDIT
842ae4bd224140319ae7feec1872b93dfd491143fielding XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes -->
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<title>mod_cache - Apache HTTP Server</title>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<link href="/images/favicon.ico" rel="shortcut icon" /></head>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<body>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div id="page-header">
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<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>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<p class="apache">Apache HTTP Server Version 2.1</p>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<img alt="" src="/images/feather.gif" /></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
e8f95a682820a599fe41b22977010636be5c2717jim<div id="path">
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<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-project/">Documentation</a> &gt; <a href="../">Version 2.1</a> &gt; <a href="./">Modules</a></div>
e8f95a682820a599fe41b22977010636be5c2717jim<div id="page-content">
1747d30b98aa1bdbc43994c02cd46ab4cb9319e4fielding<div id="preamble"><h1>Apache Module mod_cache</h1>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="toplang">
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<p><span>Available Languages: </span><a href="/en/mod/mod_cache.html" title="English">&nbsp;en&nbsp;</a> |
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<a href="/ko/mod/mod_cache.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes</div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Content cache keyed to URIs.</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>cache_module</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_cache.c</td></tr></table>
11f2c481e1d57bedb3f758565307501e9a2730ddtrawick<h3>Summary</h3>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <div class="warning">
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes This module is experimental. Documentation is still under development...
5c0419d51818eb02045cf923a9fe456127a44c60wrowe </div>
5c0419d51818eb02045cf923a9fe456127a44c60wrowe
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <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
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes content cache that can be used to cache either local or proxied content.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> requires the services of one or more storage
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes management modules. Two storage management modules are included in
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes the base Apache distribution:</p>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <dl>
d266c3777146d36a4c23c17aad6f153aebea1bf4jorton <dt><code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code></dt>
d266c3777146d36a4c23c17aad6f153aebea1bf4jorton <dd>implements a disk based storage manager.</dd>
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes <dt><code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code></dt>
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes <dd>implements a memory based storage manager.
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> can be configured to operate in two
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes modes: caching open file descriptors or caching objects in heap storage.
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code> can be used to cache locally generated content
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes or to cache backend server content for <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code> when
cd3bbd6d2df78d6c75e5d159a81ef8bdd5f70df9trawick configured using <code class="directive"><a href="/mod/mod_proxy.html#proxypass">ProxyPass</a></code>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes (aka <dfn>reverse proxy</dfn>)</dd>
0f60998368b493f90120180a93fc2e1e74490872covener </dl>
0f60998368b493f90120180a93fc2e1e74490872covener
0f60998368b493f90120180a93fc2e1e74490872covener <p>Content is stored in and retrieved from the cache using URI based keys. Content with
0f60998368b493f90120180a93fc2e1e74490872covener access protection is not cached.</p>
0f60998368b493f90120180a93fc2e1e74490872covener</div>
0f60998368b493f90120180a93fc2e1e74490872covener<div id="quickview"><h3 class="directives">Directives</h3>
0f60998368b493f90120180a93fc2e1e74490872covener<ul id="toc">
0f60998368b493f90120180a93fc2e1e74490872covener<li><img alt="" src="/images/down.gif" /> <a href="#cachedefaultexpire">CacheDefaultExpire</a></li>
87587593f1a53030e840acc0dec6cc881022ea40covener<li><img alt="" src="/images/down.gif" /> <a href="#cachedisable">CacheDisable</a></li>
87587593f1a53030e840acc0dec6cc881022ea40covener<li><img alt="" src="/images/down.gif" /> <a href="#cacheenable">CacheEnable</a></li>
87587593f1a53030e840acc0dec6cc881022ea40covener<li><img alt="" src="/images/down.gif" /> <a href="#cacheforcecompletion">CacheForceCompletion</a></li>
87587593f1a53030e840acc0dec6cc881022ea40covener<li><img alt="" src="/images/down.gif" /> <a href="#cacheignorecachecontrol">CacheIgnoreCacheControl</a></li>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<li><img alt="" src="/images/down.gif" /> <a href="#cacheignoreheaders">CacheIgnoreHeaders</a></li>
43997561b2302d13dee973998e77743a3ddd2374trawick<li><img alt="" src="/images/down.gif" /> <a href="#cacheignorenolastmod">CacheIgnoreNoLastMod</a></li>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<li><img alt="" src="/images/down.gif" /> <a href="#cachelastmodifiedfactor">CacheLastModifiedFactor</a></li>
0568280364eb026393be492ebc732795c4934643jorton<li><img alt="" src="/images/down.gif" /> <a href="#cachemaxexpire">CacheMaxExpire</a></li>
0568280364eb026393be492ebc732795c4934643jorton</ul>
0568280364eb026393be492ebc732795c4934643jorton<h3>Topics</h3>
0568280364eb026393be492ebc732795c4934643jorton<ul id="topics">
0568280364eb026393be492ebc732795c4934643jorton<li><img alt="" src="/images/down.gif" /> <a href="#related">Related Modules and Directives</a></li>
0568280364eb026393be492ebc732795c4934643jorton<li><img alt="" src="/images/down.gif" /> <a href="#sampleconf">Sample Configuration</a></li>
0568280364eb026393be492ebc732795c4934643jorton</ul></div>
0568280364eb026393be492ebc732795c4934643jorton<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
0568280364eb026393be492ebc732795c4934643jorton<div class="section">
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<h2><a name="related" id="related">Related Modules and Directives</a></h2>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <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>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="section">
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<h2><a name="sampleconf" id="sampleconf">Sample Configuration</a></h2>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <div class="example"><h3>Sample httpd.conf</h3><p><code>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes #<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes # Sample Cache Configuration<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes #<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes LoadModule cache_module modules/mod_cache.so<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <br />
796e4a7141265d8ed7036e4628161c6eafb2a789jorton &lt;IfModule mod_cache.c&gt;<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <span class="indent">
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes #LoadModule disk_cache_module modules/mod_disk_cache.so<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes &lt;IfModule mod_disk_cache.c&gt;<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <span class="indent">
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheRoot c:/cacheroot<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheSize 256<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheEnable disk /<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheDirLevels 5<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheDirLength 3<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes </span>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes &lt;/IfModule&gt; <br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes LoadModule mem_cache_module modules/mod_mem_cache.so<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes &lt;IfModule mod_mem_cache.c&gt;<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <span class="indent">
8113dac419143273351446c3ad653f3fe5ba5cfdwrowe CacheEnable mem /<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes MCacheSize 4096<br />
95b6fe1346805e1731e6e97c15d569c73be22cf7minfrin MCacheMaxObjectCount 100<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes MCacheMinObjectSize 1<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes MCacheMaxObjectSize 2048<br />
95b6fe1346805e1731e6e97c15d569c73be22cf7minfrin </span>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes &lt;/IfModule&gt;<br />
95b6fe1346805e1731e6e97c15d569c73be22cf7minfrin </span>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes &lt;/IfModule&gt;
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes </code></p></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes</div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="directive-section"><h2><a name="CacheDefaultExpire" id="CacheDefaultExpire">CacheDefaultExpire</a> <a name="cachedefaultexpire" id="cachedefaultexpire">Directive</a></h2>
95b6fe1346805e1731e6e97c15d569c73be22cf7minfrin<table class="directive">
95b6fe1346805e1731e6e97c15d569c73be22cf7minfrin<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>
95b6fe1346805e1731e6e97c15d569c73be22cf7minfrin<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheDefaultExpire <var>seconds</var></code></td></tr>
a1790fb35c4b352dab721370985c623a9f8f5062rpluem<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheDefaultExpire 3600 (one hour)</code></td></tr>
713a2b68bac4aeb1e9c48785006c0732451039depquerna<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes</table>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <p>The <code class="directive">CacheDefaultExpire</code> directive specifies a default time,
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes in seconds, to cache a document if neither an expiry date nor last-modified date are provided
482f676c6c19b1c5bb5cca04dad11509c1da3a4cwrowe with the document. The value specified with the <code class="directive">CacheMaxExpire</code>
482f676c6c19b1c5bb5cca04dad11509c1da3a4cwrowe directive does <em>not</em> override this setting.</p>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <div class="example"><p><code>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheDefaultExpire 86400
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes </code></p></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes</div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="directive-section"><h2><a name="CacheDisable" id="CacheDisable">CacheDisable</a> <a name="cachedisable" id="cachedisable">Directive</a></h2>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<table class="directive">
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Disable caching of specified URLs</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheDisable <var> url-string</var></code></td></tr>
f43b67c5a9d29b572eac916f8335cedc80c908bebnicholes<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
8113dac419143273351446c3ad653f3fe5ba5cfdwrowe</table>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <p>The <code class="directive">CacheDisable</code> directive instructs
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> to <em>not</em> cache urls at or below
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <var>url-string</var>.</p>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <div class="example"><h3>Example</h3><p><code>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheDisable /local_files
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes </code></p></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes</div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="directive-section"><h2><a name="CacheEnable" id="CacheEnable">CacheEnable</a> <a name="cacheenable" id="cacheenable">Directive</a></h2>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<table class="directive">
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable caching of specified URLs using a specified storage
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenermanager</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<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>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes</table>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <p>The <code class="directive">CacheEnable</code> directive instructs
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> to cache urls at or below
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <var>url-string</var>. The cache storage manager is specified with the
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <var>cache_type</var> argument. <var>cache_type</var> <code> mem</code>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes instructs <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> to use the memory based storage
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes manager implemented by <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code>.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <var>cache_type</var> <code>disk</code> instructs
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> to use the disk based storage manager
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes implemented by <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code>.
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <var>cache_type</var> <code>fd</code> instructs
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> to use the file descriptor cache implemented
8113dac419143273351446c3ad653f3fe5ba5cfdwrowe by <code class="module"><a href="/mod/mod_mem_cache.html">mod_mem_cache</a></code>.</p>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <p>In the event that the URL space overlaps between different
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <code class="directive">CacheEnable</code> directives (as in the example below),
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes each possible storage manager will be run until the first one that
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes actually processes the request. The order in which the storage managers are
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes run is determined by the order of the <code class="directive">CacheEnable</code>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes directives in the configuration file.</p>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <div class="example"><p><code>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheEnable mem /manual<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheEnable fd /images<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheEnable disk /<br />
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes </code></p></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes</div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="directive-section"><h2><a name="CacheForceCompletion" id="CacheForceCompletion">CacheForceCompletion</a> <a name="cacheforcecompletion" id="cacheforcecompletion">Directive</a></h2>
1f299703465bd9975d94e9f229f76af807442de2covener<table class="directive">
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Percentage of document served, after which the server
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerwill complete caching the file even if the request is cancelled.</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheForceCompletion <var>Percentage</var></code></td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheForceCompletion 60</code></td></tr>
8113dac419143273351446c3ad653f3fe5ba5cfdwrowe<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes</table>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <p>Ordinarily, if a request is cancelled while the response is being
9ad7b260be233be7d7b5576979825cac72e15498rederpj cached and delivered to the client the processing of the response will
9ad7b260be233be7d7b5576979825cac72e15498rederpj stop and the cache entry will be removed. The
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <code class="directive">CacheForceCompletion</code> directive specifies a
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes threshold beyond which the document will continue to be cached to
f43b67c5a9d29b572eac916f8335cedc80c908bebnicholes completion, even if the request is cancelled.</p>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <p>The threshold is a percentage specified as a value between
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <code>1</code> and <code>100</code>. A value of <code>0</code>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes specifies that the default be used. A value of <code>100</code>
f2be127030aa4190033084f0a6add531c9bc41desf will only cache documents that are served in their entirety. A value
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes between 60 and 90 is recommended.</p>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <div class="example"><p><code>
f2be127030aa4190033084f0a6add531c9bc41desf CacheForceCompletion 80
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes </code></p></div>
3e6d7277b90d3011db832139afc20efb5f17e203rederpj
3e6d7277b90d3011db832139afc20efb5f17e203rederpj <div class="warning"><h3>Note:</h3>
3e6d7277b90d3011db832139afc20efb5f17e203rederpj This feature is currently <em>not</em> implemented.
3e6d7277b90d3011db832139afc20efb5f17e203rederpj </div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
f43b67c5a9d29b572eac916f8335cedc80c908bebnicholes</div>
e8f95a682820a599fe41b22977010636be5c2717jim<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
f2be127030aa4190033084f0a6add531c9bc41desf<div class="directive-section"><h2><a name="CacheIgnoreCacheControl" id="CacheIgnoreCacheControl">CacheIgnoreCacheControl</a> <a name="cacheignorecachecontrol" id="cacheignorecachecontrol">Directive</a></h2>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<table class="directive">
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Ignore the fact that the client requested the content not be
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenercached.</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheIgnoreCacheControl On|Off</code></td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheIgnoreCacheControl Off</code></td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener</table>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <p>Ordinarily, documents with no-cache or no-store header values will not be stored in the cache.
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener The <code class="directive">CacheIgnoreCacheControl</code> directive allows this behavior to be overridden.
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <code class="directive">CacheIgnoreCacheControl</code> On tells the server to attempt to cache the document
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener even if it contains no-cache or no-store header values. Documents requiring authorization will
6683642c1e0032eeeed5f99e8c14880692ef84c5sf <em>never</em> be cached.</p>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <div class="example"><p><code>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener CacheIgnoreCacheControl On
6683642c1e0032eeeed5f99e8c14880692ef84c5sf </code></p></div>
6683642c1e0032eeeed5f99e8c14880692ef84c5sf
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener</div>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<div class="directive-section"><h2><a name="CacheIgnoreHeaders" id="CacheIgnoreHeaders">CacheIgnoreHeaders</a> <a name="cacheignoreheaders" id="cacheignoreheaders">Directive</a></h2>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<table class="directive">
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Do not store the given HTTP header(s) in the cache.
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<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>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheIgnoreHeaders None</code></td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener</table>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <p>According to RFC 2616, hop-by-hop HTTP headers are not stored in
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener the cache. The following HTTP headers are hop-by-hop headers and thus
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener do not get stored in the cache in <em>any</em> case regardless of the
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener setting of <code class="directive">CacheIgnoreHeaders</code>:</p>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <ul>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <li><code>Connection</code></li>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <li><code>Keep-Alive</code></li>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <li><code>Proxy-Authenticate</code></li>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <li><code>Proxy-Authorization</code></li>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <li><code>TE</code></li>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <li><code>Trailers</code></li>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <li><code>Transfer-Encoding</code></li>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <li><code>Upgrade</code></li>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener </ul>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <p><code class="directive">CacheIgnoreHeaders</code> specifies additional HTTP
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener headers that should not to be stored in the cache. For example, it makes
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener sense in some cases to prevent cookies from being stored in the cache.</p>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <p><code class="directive">CacheIgnoreHeaders</code> takes a space separated list
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener of HTTP headers that should not be stored in the cache. If only hop-by-hop
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener headers not should be stored in the cache (the RFC 2616 compliant
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener behaviour), <code class="directive">CacheIgnoreHeaders</code> can be set to
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <code>None</code>.</p>
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener <div class="example"><h3>Example 1</h3><p><code>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheIgnoreHeaders Set-Cookie
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes </code></p></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes <div class="example"><h3>Example 2</h3><p><code>
0e05808dc59a321566303084c84b9826a4353cefrederpj CacheIgnoreHeaders None
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes </code></p></div>
b08925593f214f621161742925dcf074a8047e0acovener
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <div class="warning"><h3>Warning:</h3>
54d22ed1c429b903b029bbd62621f11a9e286137minfrin If headers like <code>Expires</code> which are needed for proper cache
465bb68501690d7a47bfd2a6129580047d76d8f1rederpj management are not stored due to a
4be9c459920a7c1cfe62d654327dae5c4bb6b284sf <code class="directive">CacheIgnoreHeaders</code> setting, the behaviour of
465bb68501690d7a47bfd2a6129580047d76d8f1rederpj mod_cache is undefined.
e8f95a682820a599fe41b22977010636be5c2717jim </div>
3dfeb02cfb853d8717ca0cc259b59fea610173f5bnicholes
3dfeb02cfb853d8717ca0cc259b59fea610173f5bnicholes</div>
54d22ed1c429b903b029bbd62621f11a9e286137minfrin<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<div class="directive-section"><h2><a name="CacheIgnoreNoLastMod" id="CacheIgnoreNoLastMod">CacheIgnoreNoLastMod</a> <a name="cacheignorenolastmod" id="cacheignorenolastmod">Directive</a></h2>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<table class="directive">
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Ignore the fact that a response has no Last Modified
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholesheader.</td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheIgnoreNoLastMod On|Off</code></td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheIgnoreNoLastMod Off</code></td></tr>
ebe5305f8b22507374358f32b74d12fb50c05a25covener<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes</table>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes <p>Ordinarily, documents without a last-modified date are not cached.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes Under some circumstances the last-modified date is removed (during
513b324e774c559b579896df131fd7c8471ed529rederpj <code class="module"><a href="/mod/mod_include.html">mod_include</a></code> processing for example) or not provided
513b324e774c559b579896df131fd7c8471ed529rederpj at all. The <code class="directive">CacheIgnoreNoLastMod</code> directive
513b324e774c559b579896df131fd7c8471ed529rederpj provides a way to specify that documents without last-modified dates
513b324e774c559b579896df131fd7c8471ed529rederpj should be considered for caching, even without a last-modified date.
513b324e774c559b579896df131fd7c8471ed529rederpj If neither a last-modified date nor an expiry date are provided with
513b324e774c559b579896df131fd7c8471ed529rederpj the document then the value specified by the
513b324e774c559b579896df131fd7c8471ed529rederpj <code class="directive">CacheDefaultExpire</code> directive will be used to
513b324e774c559b579896df131fd7c8471ed529rederpj generate an expiration date.</p>
513b324e774c559b579896df131fd7c8471ed529rederpj
513b324e774c559b579896df131fd7c8471ed529rederpj <div class="example"><p><code>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes CacheIgnoreNoLastMod On
02fd88c85a9850109753b87612955ad372de1575sf </code></p></div>
02fd88c85a9850109753b87612955ad372de1575sf
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes</div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<div class="directive-section"><h2><a name="CacheLastModifiedFactor" id="CacheLastModifiedFactor">CacheLastModifiedFactor</a> <a name="cachelastmodifiedfactor" id="cachelastmodifiedfactor">Directive</a></h2>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<table class="directive">
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The factor used to compute an expiry date based on the
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholesLastModified date.</td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheLastModifiedFactor <var>float</var></code></td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheLastModifiedFactor 0.1</code></td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes</table>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes <p>In the event that a document does not provide an expiry date but does
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes provide a last-modified date, an expiry date can be calculated based on
9ad7b260be233be7d7b5576979825cac72e15498rederpj the time since the document was last modified. The
9ad7b260be233be7d7b5576979825cac72e15498rederpj <code class="directive">CacheLastModifiedFactor</code> directive specifies a
9ad7b260be233be7d7b5576979825cac72e15498rederpj <var>factor</var> to be used in the generation of this expiry date
9ad7b260be233be7d7b5576979825cac72e15498rederpj according to the following formula:
9ad7b260be233be7d7b5576979825cac72e15498rederpj
9ad7b260be233be7d7b5576979825cac72e15498rederpj <code>expiry-period = time-since-last-modified-date * <var>factor</var>
9ad7b260be233be7d7b5576979825cac72e15498rederpj expiry-date = current-date + expiry-period</code>
9ad7b260be233be7d7b5576979825cac72e15498rederpj
9ad7b260be233be7d7b5576979825cac72e15498rederpj For example, if the document was last modified 10 hours ago, and
9ad7b260be233be7d7b5576979825cac72e15498rederpj <var>factor</var> is 0.1 then the expiry-period will be set to
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes 10*0.1 = 1 hour. If the current time was 3:00pm then the computed
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes expiry-date would be 3:00pm + 1hour = 4:00pm.
54d22ed1c429b903b029bbd62621f11a9e286137minfrin
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes If the expiry-period would be longer than that set by
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes <code class="directive">CacheMaxExpire</code>, then the latter takes
ebe5305f8b22507374358f32b74d12fb50c05a25covener precedence.</p>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes <div class="example"><p><code>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes CacheLastModifiedFactor 0.5
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes </code></p></div>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes
54d22ed1c429b903b029bbd62621f11a9e286137minfrin</div>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
54d22ed1c429b903b029bbd62621f11a9e286137minfrin<div class="directive-section"><h2><a name="CacheMaxExpire" id="CacheMaxExpire">CacheMaxExpire</a> <a name="cachemaxexpire" id="cachemaxexpire">Directive</a></h2>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<table class="directive">
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The maximum time in seconds to cache a document</td></tr>
ebe5305f8b22507374358f32b74d12fb50c05a25covener<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheMaxExpire <var>seconds</var></code></td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheMaxExpire 86400 (one day)</code></td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_cache</td></tr>
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes</table>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes <p>The <code class="directive">CacheMaxExpire</code> directive specifies the maximum number of
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes seconds for which cachable HTTP documents will be retained without checking the origin
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes server. Thus, documents will be out of date at most this number of seconds. This maximum
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes value is enforced even if an expiry date was supplied with the document.</p>
b08925593f214f621161742925dcf074a8047e0acovener
b08925593f214f621161742925dcf074a8047e0acovener <div class="example"><p><code>
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes CacheMaxExpire 604800
9ad7b260be233be7d7b5576979825cac72e15498rederpj </code></p></div>
9ad7b260be233be7d7b5576979825cac72e15498rederpj
9ad7b260be233be7d7b5576979825cac72e15498rederpj</div>
128a5d93141a86e3afa151e921035a07297c9833rederpj</div>
9ad7b260be233be7d7b5576979825cac72e15498rederpj<div class="bottomlang">
9ad7b260be233be7d7b5576979825cac72e15498rederpj<p><span>Available Languages: </span><a href="/en/mod/mod_cache.html" title="English">&nbsp;en&nbsp;</a> |
128a5d93141a86e3afa151e921035a07297c9833rederpj<a href="/ko/mod/mod_cache.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
128a5d93141a86e3afa151e921035a07297c9833rederpj</div><div id="footer">
9ad7b260be233be7d7b5576979825cac72e15498rederpj<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>
9ad7b260be233be7d7b5576979825cac72e15498rederpj<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>
9ad7b260be233be7d7b5576979825cac72e15498rederpj</body></html>