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