mod_cache.xml revision 89ebbccde2b87b469b9d6fdb606eeb943c12a824
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<?xml version="1.0"?>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<!-- $LastChangedRevision$ -->
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<!--
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell Copyright 2002-2005 The Apache Software Foundation or its licensors, as
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell applicable.
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell Licensed under the Apache License, Version 2.0 (the "License");
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell you may not use this file except in compliance with the License.
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell You may obtain a copy of the License at
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell http://www.apache.org/licenses/LICENSE-2.0
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell Unless required by applicable law or agreed to in writing, software
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell distributed under the License is distributed on an "AS IS" BASIS,
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
c007849bbb809877e23d714ab629dea788abceddCraig McDonnell See the License for the specific language governing permissions and
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell limitations under the License.
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell-->
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<modulesynopsis metafile="mod_cache.xml.meta">
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<name>mod_cache</name>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<description>Content cache keyed to URIs.</description>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<status>Extension</status>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<sourcefile>mod_cache.c</sourcefile>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<identifier>cache_module</identifier>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<summary>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <p><module>mod_cache</module> implements an <a
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616</a> compliant HTTP
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell content cache that can be used to cache either local or proxied content.
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <module>mod_cache</module> requires the services of one or more storage
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell management modules. Two storage management modules are included in
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell the base Apache distribution:</p>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <dl>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <dt><module>mod_disk_cache</module></dt>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <dd>implements a disk based storage manager.</dd>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <dt><module>mod_mem_cache</module></dt>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <dd>implements a memory based storage manager.
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <module>mod_mem_cache</module> can be configured to operate in two
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell modes: caching open file descriptors or caching objects in heap storage.
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <module>mod_mem_cache</module> can be used to cache locally generated content
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell or to cache backend server content for <module>mod_proxy</module> when
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell configured using <directive module="mod_proxy">ProxyPass</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell (aka <dfn>reverse proxy</dfn>)</dd>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </dl>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <p>Content is stored in and retrieved from the cache using URI based keys. Content with
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell access protection is not cached.</p>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</summary>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<section id="related"><title>Related Modules and Directives</title>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <related>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <modulelist>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <module>mod_disk_cache</module>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <module>mod_mem_cache</module>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </modulelist>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directivelist>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_disk_cache">CacheRoot</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_disk_cache">CacheSize</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_disk_cache">CacheDirLevels</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_disk_cache">CacheDirLength</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_disk_cache">CacheMinFileSize</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_disk_cache">CacheMaxFileSize</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_mem_cache">MCacheSize</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_mem_cache">MCacheMaxObjectCount</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_mem_cache">MCacheMinObjectSize</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_mem_cache">MCacheMaxObjectSize</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_mem_cache">MCacheRemovalAlgorithm</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive module="mod_mem_cache">MCacheMaxStreamingBuffer</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </directivelist>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </related>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</section>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<section id="sampleconf"><title>Sample Configuration</title>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <example><title>Sample httpd.conf</title>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell #<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell # Sample Cache Configuration<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell #<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell LoadModule cache_module modules/mod_cache.so<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell &lt;IfModule mod_cache.c&gt;<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <indent>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell #LoadModule disk_cache_module modules/mod_disk_cache.so<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell # If you want to use mod_disk_cache instead of mod_mem_cache,<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell # uncomment the line above and comment out the LoadModule line below.<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell &lt;IfModule mod_disk_cache.c&gt;<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <indent>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheRoot c:/cacheroot<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheEnable disk /<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheDirLevels 5<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheDirLength 3<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </indent>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell &lt;/IfModule&gt; <br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell LoadModule mem_cache_module modules/mod_mem_cache.so<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell &lt;IfModule mod_mem_cache.c&gt;<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <indent>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheEnable mem /<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell MCacheSize 4096<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell MCacheMaxObjectCount 100<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell MCacheMinObjectSize 1<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell MCacheMaxObjectSize 2048<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </indent>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell &lt;/IfModule&gt;<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell # When acting as a proxy, don't cache the list of security updates<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheDisable http://security.update.server/update-list/<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </indent>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell &lt;/IfModule&gt;
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</section>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<name>CacheEnable</name>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<description>Enable caching of specified URLs using a specified storage
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnellmanager</description>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<syntax>CacheEnable <var>cache_type</var> <var>url-string</var></syntax>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<contextlist><context>server config</context><context>virtual host</context>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</contextlist>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <p>The <directive>CacheEnable</directive> directive instructs
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <module>mod_cache</module> to cache urls at or below
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <var>url-string</var>. The cache storage manager is specified with the
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <var>cache_type</var> argument. <var>cache_type</var> <code> mem</code>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell instructs <module>mod_cache</module> to use the memory based storage
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell manager implemented by <module>mod_mem_cache</module>.
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <var>cache_type</var> <code>disk</code> instructs
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <module>mod_cache</module> to use the disk based storage manager
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell implemented by <module>mod_disk_cache</module>.
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <var>cache_type</var> <code>fd</code> instructs
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <module>mod_cache</module> to use the file descriptor cache implemented
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell by <module>mod_mem_cache</module>.</p>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <p>In the event that the URL space overlaps between different
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive>CacheEnable</directive> directives (as in the example below),
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell each possible storage manager will be run until the first one that
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell actually processes the request. The order in which the storage managers are
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell run is determined by the order of the <directive>CacheEnable</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell directives in the configuration file.</p>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheEnable mem /manual<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheEnable fd /images<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheEnable disk /<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <p>When acting as a forward proxy server, <var>url-string</var> can
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell also be used to specify remote sites and proxy protocols which
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell caching should be enabled for.</p>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell # Cache proxied url's<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheEnable disk /<br /><br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell # Cache FTP-proxied url's<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheEnable disk ftp://<br /><br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell # Cache content from www.apache.org<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheEnable disk http://www.apache.org/<br />
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<name>CacheDisable</name>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<description>Disable caching of specified URLs</description>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<syntax>CacheDisable <var> url-string</var></syntax>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<contextlist><context>server config</context><context>virtual host</context>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</contextlist>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <p>The <directive>CacheDisable</directive> directive instructs
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <module>mod_cache</module> to <em>not</em> cache urls at or below
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <var>url-string</var>.</p>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <example><title>Example</title>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheDisable /local_files
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<name>CacheMaxExpire</name>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<description>The maximum time in seconds to cache a document</description>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<syntax>CacheMaxExpire <var>seconds</var></syntax>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<default>CacheMaxExpire 86400 (one day)</default>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<contextlist><context>server config</context><context>virtual host</context>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</contextlist>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <p>The <directive>CacheMaxExpire</directive> directive specifies the maximum number of
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell seconds for which cachable HTTP documents will be retained without checking the origin
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell server. Thus, documents will be out of date at most this number of seconds. This maximum
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell value is enforced even if an expiry date was supplied with the document.</p>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheMaxExpire 604800
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<name>CacheDefaultExpire</name>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<description>The default duration to cache a document when no expiry date is specified.</description>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<syntax>CacheDefaultExpire <var>seconds</var></syntax>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<default>CacheDefaultExpire 3600 (one hour)</default>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<contextlist><context>server config</context><context>virtual host</context>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</contextlist>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <p>The <directive>CacheDefaultExpire</directive> directive specifies a default time,
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell in seconds, to cache a document if neither an expiry date nor last-modified date are provided
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell with the document. The value specified with the <directive>CacheMaxExpire</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell directive does <em>not</em> override this setting.</p>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheDefaultExpire 86400
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<name>CacheIgnoreNoLastMod</name>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<description>Ignore the fact that a response has no Last Modified
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnellheader.</description>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<syntax>CacheIgnoreNoLastMod On|Off</syntax>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<default>CacheIgnoreNoLastMod Off</default>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<contextlist><context>server config</context><context>virtual host</context>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</contextlist>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <p>Ordinarily, documents without a last-modified date are not cached.
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell Under some circumstances the last-modified date is removed (during
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <module>mod_include</module> processing for example) or not provided
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell at all. The <directive>CacheIgnoreNoLastMod</directive> directive
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell provides a way to specify that documents without last-modified dates
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell should be considered for caching, even without a last-modified date.
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell If neither a last-modified date nor an expiry date are provided with
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell the document then the value specified by the
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive>CacheDefaultExpire</directive> directive will be used to
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell generate an expiration date.</p>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
014065ea14b5a1e46190cd2a6014945aea15689bCraig McDonnell <example>
014065ea14b5a1e46190cd2a6014945aea15689bCraig McDonnell CacheIgnoreNoLastMod On
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<name>CacheIgnoreCacheControl</name>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<description>Ignore request to not serve cached content to client</description>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<syntax>CacheIgnoreCacheControl On|Off</syntax>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<default>CacheIgnoreCacheControl Off</default>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<contextlist><context>server config</context><context>virtual host</context>
014065ea14b5a1e46190cd2a6014945aea15689bCraig McDonnell</contextlist>
014065ea14b5a1e46190cd2a6014945aea15689bCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <p>Ordinarily, requests containing a Cache-Control: no-cache or
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell Pragma: no-cache header value will not be served from the cache. The
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <directive>CacheIgnoreCacheControl</directive> directive allows this
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell behavior to be overridden. <directive>CacheIgnoreCacheControl</directive>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell On tells the server to attempt to serve the resource from the cache even
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell if the request contains no-cache header values. Resources requiring
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell authorization will <em>never</em> be cached.</p>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <example>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell CacheIgnoreCacheControl On
014065ea14b5a1e46190cd2a6014945aea15689bCraig McDonnell </example>
014065ea14b5a1e46190cd2a6014945aea15689bCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell <note type="warning"><title>Warning:</title>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell This directive will allow serving from the cache even if the client has
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell requested that the document not be served from the cache. This might
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell result in stale content being served.
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell </note>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</usage>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<seealso><directive module="mod_cache">CacheStorePrivate</directive></seealso>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<seealso><directive module="mod_cache">CacheStoreNoStore</directive></seealso>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell</directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<directivesynopsis>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<name>CacheLastModifiedFactor</name>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<description>The factor used to compute an expiry date based on the
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnellLastModified date.</description>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<syntax>CacheLastModifiedFactor <var>float</var></syntax>
455375d46179ba24afcd3662bdfb6aaf03a9479cCraig McDonnell<default>CacheLastModifiedFactor 0.1</default>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
<usage>
<p>In the event that a document does not provide an expiry date but does
provide a last-modified date, an expiry date can be calculated based on
the time since the document was last modified. The
<directive>CacheLastModifiedFactor</directive> directive specifies a
<var>factor</var> to be used in the generation of this expiry date
according to the following formula:
<code>expiry-period = time-since-last-modified-date * <var>factor</var>
expiry-date = current-date + expiry-period</code>
For example, if the document was last modified 10 hours ago, and
<var>factor</var> is 0.1 then the expiry-period will be set to
10*0.1 = 1 hour. If the current time was 3:00pm then the computed
expiry-date would be 3:00pm + 1hour = 4:00pm.
If the expiry-period would be longer than that set by
<directive>CacheMaxExpire</directive>, then the latter takes
precedence.</p>
<example>
CacheLastModifiedFactor 0.5
</example>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheIgnoreHeaders</name>
<description>Do not store the given HTTP header(s) in the cache.
</description>
<syntax>CacheIgnoreHeaders <var>header-string</var> [<var>header-string</var>] ...</syntax>
<default>CacheIgnoreHeaders None</default>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
<usage>
<p>According to RFC 2616, hop-by-hop HTTP headers are not stored in
the cache. The following HTTP headers are hop-by-hop headers and thus
do not get stored in the cache in <em>any</em> case regardless of the
setting of <directive>CacheIgnoreHeaders</directive>:</p>
<ul>
<li><code>Connection</code></li>
<li><code>Keep-Alive</code></li>
<li><code>Proxy-Authenticate</code></li>
<li><code>Proxy-Authorization</code></li>
<li><code>TE</code></li>
<li><code>Trailers</code></li>
<li><code>Transfer-Encoding</code></li>
<li><code>Upgrade</code></li>
</ul>
<p><directive>CacheIgnoreHeaders</directive> specifies additional HTTP
headers that should not to be stored in the cache. For example, it makes
sense in some cases to prevent cookies from being stored in the cache.</p>
<p><directive>CacheIgnoreHeaders</directive> takes a space separated list
of HTTP headers that should not be stored in the cache. If only hop-by-hop
headers not should be stored in the cache (the RFC 2616 compliant
behaviour), <directive>CacheIgnoreHeaders</directive> can be set to
<code>None</code>.</p>
<example><title>Example 1</title>
CacheIgnoreHeaders Set-Cookie
</example>
<example><title>Example 2</title>
CacheIgnoreHeaders None
</example>
<note type="warning"><title>Warning:</title>
If headers like <code>Expires</code> which are needed for proper cache
management are not stored due to a
<directive>CacheIgnoreHeaders</directive> setting, the behaviour of
mod_cache is undefined.
</note>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheStorePrivate</name>
<description>Attempt to cache responses that the server has marked as private</description>
<syntax>CacheStorePrivate On|Off</syntax>
<default>CacheStorePrivate Off</default>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
<usage>
<p>Ordinarily, responses with Cache-Control: private header values will not
be stored in the cache. The <directive>CacheStorePrivate</directive>
directive allows this behavior to be overridden.
<directive>CacheStorePrivate</directive> On
tells the server to attempt to cache the resource even if it contains
private header values. Resources requiring authorization will
<em>never</em> be cached.</p>
<example>
CacheStorePrivate On
</example>
<note type="warning"><title>Warning:</title>
This directive will allow caching even if the upstream server has
requested that the resource not be cached. This directive is only
ideal for a 'private' cache.
</note>
</usage>
<seealso><directive module="mod_cache">CacheIgnoreCacheControl</directive></seealso>
<seealso><directive module="mod_cache">CacheStoreNoStore</directive></seealso>
</directivesynopsis>
<directivesynopsis>
<name>CacheStoreNoStore</name>
<description>Attempt to cache requests or responses that have been marked as no-store.</description>
<syntax>CacheStoreNoStore On|Off</syntax>
<default>CacheStoreNoStore Off</default>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
<usage>
<p>Ordinarily, requests or responses with Cache-Control: no-store header
values will not be stored in the cache. The
<directive>CacheStoreNoCache</directive> directive allows this
behavior to be overridden. <directive>CacheStoreNoCache</directive> On
tells the server to attempt to cache the resource even if it contains
no-store header values. Resources requiring authorization will
<em>never</em> be cached.</p>
<example>
CacheStoreNoStore On
</example>
<note type="warning"><title>Warning:</title>
As described in RFC 2616, the no-store directive is intended to
"prevent the inadvertent release or retention of sensitive information
(for example, on backup tapes)." Enabling this option could store
sensitive information in the cache. You are hereby warned.
</note>
</usage>
<seealso><directive module="mod_cache">CacheIgnoreCacheControl</directive></seealso>
<seealso><directive module="mod_cache">CacheStorePrivate</directive></seealso>
</directivesynopsis>
</modulesynopsis>