mod_cache.xml revision 8d36abdf61277cb8ffcecc763c8a86c28f11f8e9
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard<?xml version="1.0"?>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<!--
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding Licensed to the Apache Software Foundation (ASF) under one or more
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding contributor license agreements. See the NOTICE file distributed with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding this work for additional information regarding copyright ownership.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding The ASF licenses this file to You under the Apache License, Version 2.0
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding (the "License"); you may not use this file except in compliance with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding the License. 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-->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
7db9f691a00ead175b03335457ca296a33ddf31bnd<modulesynopsis metafile="mod_cache.xml.meta">
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard<name>mod_cache</name>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin<description>Content cache keyed to URIs.</description>
2f2ba5fb35129a32c3add3a797fa47e28ce3224cnd<status>Extension</status>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard<sourcefile>mod_cache.c</sourcefile>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard<identifier>cache_module</identifier>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard<summary>
7b467aa53854c95318a1c709709c1619a4f47118minfrin <note type="warning">This module should be used with care and
7b467aa53854c95318a1c709709c1619a4f47118minfrin can be used to circumvent <directive
7b467aa53854c95318a1c709709c1619a4f47118minfrin module="mod_authz_host">Allow</directive> and <directive
b77f6f03c0b6bbc6ecd6e87358f568024733d680colm module="mod_authz_host">Deny</directive> directives. You
7b467aa53854c95318a1c709709c1619a4f47118minfrin should not enable caching for any content to which you wish
7b467aa53854c95318a1c709709c1619a4f47118minfrin to limit access by client host name, address or environment
7b467aa53854c95318a1c709709c1619a4f47118minfrin variable.</note>
b77f6f03c0b6bbc6ecd6e87358f568024733d680colm
b77f6f03c0b6bbc6ecd6e87358f568024733d680colm <p><module>mod_cache</module> implements an <a
15f37a157fbbf107658ed82ec30c348a9b6e518end href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616</a> compliant HTTP
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin content cache that can be used to cache either local or proxied content.
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <module>mod_cache</module> requires the services of one or more storage
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin management modules. One storage management module is included in
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin the base Apache distribution:</p>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <dl>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <dt><module>mod_disk_cache</module></dt>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <dd>implements a disk based storage manager.</dd>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin </dl>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <p>Content is stored in and retrieved from the cache using URI based keys. Content with
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin access protection is not cached.</p>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <p>Further details, discussion, and examples, are provided in the
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <a href="/caching.html">Caching Guide</a>.</p>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin</summary>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin<seealso><a href="/caching.html">Caching Guide</a></seealso>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin<section id="related"><title>Related Modules and Directives</title>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <related>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <modulelist>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <module>mod_disk_cache</module>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin </modulelist>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <directivelist>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <directive module="mod_disk_cache">CacheRoot</directive>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <directive module="mod_disk_cache">CacheDirLevels</directive>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <directive module="mod_disk_cache">CacheDirLength</directive>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <directive module="mod_disk_cache">CacheMinFileSize</directive>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <directive module="mod_disk_cache">CacheMaxFileSize</directive>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin </directivelist>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin </related>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin</section>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin<section id="sampleconf"><title>Sample Configuration</title>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <example><title>Sample httpd.conf</title>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin #<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin # Sample Cache Configuration<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin #<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin LoadModule cache_module modules/mod_cache.so<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin &lt;IfModule mod_cache.c&gt;<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <indent>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin LoadModule disk_cache_module modules/mod_disk_cache.so<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin &lt;IfModule mod_disk_cache.c&gt;<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <indent>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin CacheRoot c:/cacheroot<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin CacheEnable disk /<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin CacheDirLevels 5<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin CacheDirLength 3<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin </indent>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin &lt;/IfModule&gt; <br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin # When acting as a proxy, don't cache the list of security updates<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin CacheDisable http://security.update.server/update-list/<br />
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin </indent>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin &lt;/IfModule&gt;
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin </example>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin</section>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin<directivesynopsis>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin<name>CacheEnable</name>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin<description>Enable caching of specified URLs using a specified storage
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrinmanager</description>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin<syntax>CacheEnable <var>cache_type</var> <var>url-string</var></syntax>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin<contextlist><context>server config</context><context>virtual host</context>
3e5f26422e7931e8838f3c844adc4282ef269cdfstoddard</contextlist>
3ec4de296cf8eb31d8a59811b58720efafccf109patrikj
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin<usage>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <p>The <directive>CacheEnable</directive> directive instructs
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <module>mod_cache</module> to cache urls at or below
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <var>url-string</var>. The cache storage manager is specified with the
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <var>cache_type</var> argument.
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <var>cache_type</var> <code>disk</code> instructs
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <module>mod_cache</module> to use the disk based storage manager
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin implemented by <module>mod_disk_cache</module>.</p>
3ec4de296cf8eb31d8a59811b58720efafccf109patrikj <p>In the event that the URL space overlaps between different
15f37a157fbbf107658ed82ec30c348a9b6e518end <directive>CacheEnable</directive> directives (as in the example below),
b536777217c919cacb1a6f18eaeff001f3b3f13crbowen each possible storage manager will be run until the first one that
b536777217c919cacb1a6f18eaeff001f3b3f13crbowen actually processes the request. The order in which the storage managers are
88c775368960b64afcdfd93a812f466a109746baerikabele run is determined by the order of the <directive>CacheEnable</directive>
b536777217c919cacb1a6f18eaeff001f3b3f13crbowen directives in the configuration file.</p>
1e5b300cc68389a18fe3762b1b980b0c86712ba1stoddard
88c775368960b64afcdfd93a812f466a109746baerikabele <p>When acting as a forward proxy server, <var>url-string</var> can
1e5b300cc68389a18fe3762b1b980b0c86712ba1stoddard also be used to specify remote sites and proxy protocols which
1e5b300cc68389a18fe3762b1b980b0c86712ba1stoddard caching should be enabled for.</p>
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin
1e5b300cc68389a18fe3762b1b980b0c86712ba1stoddard <example>
1e5b300cc68389a18fe3762b1b980b0c86712ba1stoddard # Cache proxied url's<br />
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin CacheEnable disk /<br /><br />
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin # Cache FTP-proxied url's<br />
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin CacheEnable disk ftp://<br /><br />
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin # Cache content from www.apache.org<br />
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin CacheEnable disk http://www.apache.org/<br />
1e5b300cc68389a18fe3762b1b980b0c86712ba1stoddard </example>
1e5b300cc68389a18fe3762b1b980b0c86712ba1stoddard
88c775368960b64afcdfd93a812f466a109746baerikabele <p> The <code>no-cache</code> environment variable can be set to
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard disable caching on a finer grained set of resources.</p>
15f37a157fbbf107658ed82ec30c348a9b6e518end
15f37a157fbbf107658ed82ec30c348a9b6e518end</usage>
15f37a157fbbf107658ed82ec30c348a9b6e518end<seealso><a href="/env.html">Environment Variables in Apache</a></seealso>
15f37a157fbbf107658ed82ec30c348a9b6e518end</directivesynopsis>
15f37a157fbbf107658ed82ec30c348a9b6e518end
15f37a157fbbf107658ed82ec30c348a9b6e518end<directivesynopsis>
15f37a157fbbf107658ed82ec30c348a9b6e518end<name>CacheDisable</name>
15f37a157fbbf107658ed82ec30c348a9b6e518end<description>Disable caching of specified URLs</description>
15f37a157fbbf107658ed82ec30c348a9b6e518end<syntax>CacheDisable <var> url-string</var></syntax>
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin<contextlist><context>server config</context><context>virtual host</context>
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin</contextlist>
15f37a157fbbf107658ed82ec30c348a9b6e518end
15f37a157fbbf107658ed82ec30c348a9b6e518end<usage>
15f37a157fbbf107658ed82ec30c348a9b6e518end <p>The <directive>CacheDisable</directive> directive instructs
15f37a157fbbf107658ed82ec30c348a9b6e518end <module>mod_cache</module> to <em>not</em> cache urls at or below
15f37a157fbbf107658ed82ec30c348a9b6e518end <var>url-string</var>.</p>
15f37a157fbbf107658ed82ec30c348a9b6e518end
15f37a157fbbf107658ed82ec30c348a9b6e518end <example><title>Example</title>
15f37a157fbbf107658ed82ec30c348a9b6e518end CacheDisable /local_files
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm </example>
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm
15f37a157fbbf107658ed82ec30c348a9b6e518end <p> The <code>no-cache</code> environment variable can be set to
15f37a157fbbf107658ed82ec30c348a9b6e518end disable caching on a finer grained set of resources.</p>
15f37a157fbbf107658ed82ec30c348a9b6e518end</usage>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard<seealso><a href="/env.html">Environment Variables in Apache</a></seealso>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard</directivesynopsis>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<directivesynopsis>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<name>CacheMaxExpire</name>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<description>The maximum time in seconds to cache a document</description>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<syntax>CacheMaxExpire <var>seconds</var></syntax>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<default>CacheMaxExpire 86400 (one day)</default>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<contextlist><context>server config</context><context>virtual host</context>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin</contextlist>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<usage>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin <p>The <directive>CacheMaxExpire</directive> directive specifies the maximum number of
3c67b7956d44501360506a9f13a5011be73b30ecminfrin seconds for which cachable HTTP documents will be retained without checking the origin
3c67b7956d44501360506a9f13a5011be73b30ecminfrin server. Thus, documents will be out of date at most this number of seconds. This maximum
3c67b7956d44501360506a9f13a5011be73b30ecminfrin value is enforced even if an expiry date was supplied with the document.</p>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin
3c67b7956d44501360506a9f13a5011be73b30ecminfrin <example>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin CacheMaxExpire 604800
3c67b7956d44501360506a9f13a5011be73b30ecminfrin </example>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin</usage>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin</directivesynopsis>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<directivesynopsis>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<name>CacheMinExpire</name>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<description>The minimum time in seconds to cache a document</description>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<syntax>CacheMinExpire <var>seconds</var></syntax>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<default>CacheMinExpire 0</default>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<contextlist><context>server config</context><context>virtual host</context>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin</contextlist>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<usage>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin <p>The <directive>CacheMinExpire</directive> directive specifies the minimum number of
3c67b7956d44501360506a9f13a5011be73b30ecminfrin seconds for which cachable HTTP documents will be retained without checking the origin
3c67b7956d44501360506a9f13a5011be73b30ecminfrin server. This is only used if no valid expire time was supplied with the document.</p>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin
3c67b7956d44501360506a9f13a5011be73b30ecminfrin
3c67b7956d44501360506a9f13a5011be73b30ecminfrin <example>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin CacheMinExpire 3600
3c67b7956d44501360506a9f13a5011be73b30ecminfrin </example>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin</usage>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin</directivesynopsis>
b751f61885edfa8975b02c59b9604d202ffcb9bfrbowen
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<directivesynopsis>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<name>CacheDefaultExpire</name>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<description>The default duration to cache a document when no expiry date is specified.</description>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<syntax>CacheDefaultExpire <var>seconds</var></syntax>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<default>CacheDefaultExpire 3600 (one hour)</default>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<contextlist><context>server config</context><context>virtual host</context>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin</contextlist>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<usage>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin <p>The <directive>CacheDefaultExpire</directive> directive specifies a default time,
3c67b7956d44501360506a9f13a5011be73b30ecminfrin in seconds, to cache a document if neither an expiry date nor last-modified date are provided
3c67b7956d44501360506a9f13a5011be73b30ecminfrin with the document. The value specified with the <directive>CacheMaxExpire</directive>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin directive does <em>not</em> override this setting.</p>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin
3c67b7956d44501360506a9f13a5011be73b30ecminfrin <example>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin CacheDefaultExpire 86400
3c67b7956d44501360506a9f13a5011be73b30ecminfrin </example>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin</usage>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin</directivesynopsis>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<directivesynopsis>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<name>CacheIgnoreNoLastMod</name>
3c67b7956d44501360506a9f13a5011be73b30ecminfrin<description>Ignore the fact that a response has no Last Modified
3c67b7956d44501360506a9f13a5011be73b30ecminfrinheader.</description>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<syntax>CacheIgnoreNoLastMod On|Off</syntax>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<default>CacheIgnoreNoLastMod Off</default>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<contextlist><context>server config</context><context>virtual host</context>
7b467aa53854c95318a1c709709c1619a4f47118minfrin</contextlist>
7b467aa53854c95318a1c709709c1619a4f47118minfrin
7b467aa53854c95318a1c709709c1619a4f47118minfrin<usage>
f312a039cc79d35be2dcb8aa20d91b31b9394c9fminfrin <p>Ordinarily, documents without a last-modified date are not cached.
7b467aa53854c95318a1c709709c1619a4f47118minfrin Under some circumstances the last-modified date is removed (during
7b467aa53854c95318a1c709709c1619a4f47118minfrin <module>mod_include</module> processing for example) or not provided
7b467aa53854c95318a1c709709c1619a4f47118minfrin at all. The <directive>CacheIgnoreNoLastMod</directive> directive
7b467aa53854c95318a1c709709c1619a4f47118minfrin provides a way to specify that documents without last-modified dates
7b467aa53854c95318a1c709709c1619a4f47118minfrin should be considered for caching, even without a last-modified date.
7b467aa53854c95318a1c709709c1619a4f47118minfrin If neither a last-modified date nor an expiry date are provided with
7b467aa53854c95318a1c709709c1619a4f47118minfrin the document then the value specified by the
7b467aa53854c95318a1c709709c1619a4f47118minfrin <directive>CacheDefaultExpire</directive> directive will be used to
7b467aa53854c95318a1c709709c1619a4f47118minfrin generate an expiration date.</p>
7b467aa53854c95318a1c709709c1619a4f47118minfrin
7b467aa53854c95318a1c709709c1619a4f47118minfrin <example>
1fd5131d5732e639b0b4225ca0afea717c41bc11trawick CacheIgnoreNoLastMod On
7b467aa53854c95318a1c709709c1619a4f47118minfrin </example>
7b467aa53854c95318a1c709709c1619a4f47118minfrin</usage>
7b467aa53854c95318a1c709709c1619a4f47118minfrin</directivesynopsis>
7b467aa53854c95318a1c709709c1619a4f47118minfrin
7b467aa53854c95318a1c709709c1619a4f47118minfrin<directivesynopsis>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<name>CacheIgnoreCacheControl</name>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<description>Ignore request to not serve cached content to client</description>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<syntax>CacheIgnoreCacheControl On|Off</syntax>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<default>CacheIgnoreCacheControl Off</default>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<contextlist><context>server config</context><context>virtual host</context>
7b467aa53854c95318a1c709709c1619a4f47118minfrin</contextlist>
7b467aa53854c95318a1c709709c1619a4f47118minfrin
7b467aa53854c95318a1c709709c1619a4f47118minfrin<usage>
7b467aa53854c95318a1c709709c1619a4f47118minfrin <p>Ordinarily, requests containing a Cache-Control: no-cache or
7b467aa53854c95318a1c709709c1619a4f47118minfrin Pragma: no-cache header value will not be served from the cache. The
7b467aa53854c95318a1c709709c1619a4f47118minfrin <directive>CacheIgnoreCacheControl</directive> directive allows this
7b467aa53854c95318a1c709709c1619a4f47118minfrin behavior to be overridden. <directive>CacheIgnoreCacheControl</directive>
7b467aa53854c95318a1c709709c1619a4f47118minfrin On tells the server to attempt to serve the resource from the cache even
7b467aa53854c95318a1c709709c1619a4f47118minfrin if the request contains no-cache header values. Resources requiring
7b467aa53854c95318a1c709709c1619a4f47118minfrin authorization will <em>never</em> be cached.</p>
7b467aa53854c95318a1c709709c1619a4f47118minfrin
7b467aa53854c95318a1c709709c1619a4f47118minfrin <example>
7b467aa53854c95318a1c709709c1619a4f47118minfrin CacheIgnoreCacheControl On
7b467aa53854c95318a1c709709c1619a4f47118minfrin </example>
7b467aa53854c95318a1c709709c1619a4f47118minfrin
7b467aa53854c95318a1c709709c1619a4f47118minfrin <note type="warning"><title>Warning:</title>
7b467aa53854c95318a1c709709c1619a4f47118minfrin This directive will allow serving from the cache even if the client has
7b467aa53854c95318a1c709709c1619a4f47118minfrin requested that the document not be served from the cache. This might
7b467aa53854c95318a1c709709c1619a4f47118minfrin result in stale content being served.
7b467aa53854c95318a1c709709c1619a4f47118minfrin </note>
7b467aa53854c95318a1c709709c1619a4f47118minfrin</usage>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<seealso><directive module="mod_cache">CacheStorePrivate</directive></seealso>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<seealso><directive module="mod_cache">CacheStoreNoStore</directive></seealso>
7b467aa53854c95318a1c709709c1619a4f47118minfrin</directivesynopsis>
7b467aa53854c95318a1c709709c1619a4f47118minfrin
7b467aa53854c95318a1c709709c1619a4f47118minfrin<directivesynopsis>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<name>CacheIgnoreQueryString</name>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<description>Ignore query string when caching</description>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<syntax>CacheIgnoreQueryString On|Off</syntax>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<default>CacheIgnoreQueryString Off</default>
7b467aa53854c95318a1c709709c1619a4f47118minfrin<contextlist><context>server config</context><context>virtual host</context>
7b467aa53854c95318a1c709709c1619a4f47118minfrin</contextlist>
7b467aa53854c95318a1c709709c1619a4f47118minfrin
7b467aa53854c95318a1c709709c1619a4f47118minfrin<usage>
7b467aa53854c95318a1c709709c1619a4f47118minfrin <p>Ordinarily, requests with query string parameters are cached separately
7b467aa53854c95318a1c709709c1619a4f47118minfrin for each unique query string. This is according to RFC 2616/13.9 done only
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin if an expiration time is specified. The
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin <directive>CacheIgnoreQueryString</directive> directive tells the cache to
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin cache requests even if no expiration time is specified, and to reply with
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin a cached reply even if the query string differs. From a caching point of
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin view the request is treated as if having no query string when this
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin directive is enabled.</p>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin <example>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin CacheIgnoreQueryString On
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin </example>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin</usage>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin</directivesynopsis>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin<directivesynopsis>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin<name>CacheLastModifiedFactor</name>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin<description>The factor used to compute an expiry date based on the
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrinLastModified date.</description>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin<syntax>CacheLastModifiedFactor <var>float</var></syntax>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin<default>CacheLastModifiedFactor 0.1</default>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin<contextlist><context>server config</context><context>virtual host</context>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin</contextlist>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin<usage>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin <p>In the event that a document does not provide an expiry date but does
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin provide a last-modified date, an expiry date can be calculated based on
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin the time since the document was last modified. The
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin <directive>CacheLastModifiedFactor</directive> directive specifies a
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin <var>factor</var> to be used in the generation of this expiry date
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin according to the following formula:
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin <code>expiry-period = time-since-last-modified-date * <var>factor</var>
033d82412cc4af9d939b7e1645425b9e7f4ebf60minfrin expiry-date = current-date + expiry-period</code>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard For example, if the document was last modified 10 hours ago, and
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj <var>factor</var> is 0.1 then the expiry-period will be set to
15f37a157fbbf107658ed82ec30c348a9b6e518end 10*0.1 = 1 hour. If the current time was 3:00pm then the computed
15f37a157fbbf107658ed82ec30c348a9b6e518end expiry-date would be 3:00pm + 1hour = 4:00pm.
15f37a157fbbf107658ed82ec30c348a9b6e518end
15f37a157fbbf107658ed82ec30c348a9b6e518end If the expiry-period would be longer than that set by
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard <directive>CacheMaxExpire</directive>, then the latter takes
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard precedence.</p>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard
15f37a157fbbf107658ed82ec30c348a9b6e518end <example>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj CacheLastModifiedFactor 0.5
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin </example>
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin</usage>
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin</directivesynopsis>
15f37a157fbbf107658ed82ec30c348a9b6e518end
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj<directivesynopsis>
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin<name>CacheIgnoreHeaders</name>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj<description>Do not store the given HTTP header(s) in the cache.
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj</description>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj<syntax>CacheIgnoreHeaders <var>header-string</var> [<var>header-string</var>] ...</syntax>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj<default>CacheIgnoreHeaders None</default>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj<contextlist><context>server config</context><context>virtual host</context>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj</contextlist>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm<usage>
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm <p>According to RFC 2616, hop-by-hop HTTP headers are not stored in
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm the cache. The following HTTP headers are hop-by-hop headers and thus
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm do not get stored in the cache in <em>any</em> case regardless of the
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm setting of <directive>CacheIgnoreHeaders</directive>:</p>
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm <ul>
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm <li><code>Connection</code></li>
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm <li><code>Keep-Alive</code></li>
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm <li><code>Proxy-Authenticate</code></li>
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm <li><code>Proxy-Authorization</code></li>
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm <li><code>TE</code></li>
89ebbccde2b87b469b9d6fdb606eeb943c12a824colm <li><code>Trailers</code></li>
2af38cc44e48753913565b38a7a9f325f898a293minfrin <li><code>Transfer-Encoding</code></li>
2af38cc44e48753913565b38a7a9f325f898a293minfrin <li><code>Upgrade</code></li>
2af38cc44e48753913565b38a7a9f325f898a293minfrin </ul>
2af38cc44e48753913565b38a7a9f325f898a293minfrin
2af38cc44e48753913565b38a7a9f325f898a293minfrin <p><directive>CacheIgnoreHeaders</directive> specifies additional HTTP
2af38cc44e48753913565b38a7a9f325f898a293minfrin headers that should not to be stored in the cache. For example, it makes
2af38cc44e48753913565b38a7a9f325f898a293minfrin sense in some cases to prevent cookies from being stored in the cache.</p>
2af38cc44e48753913565b38a7a9f325f898a293minfrin
2af38cc44e48753913565b38a7a9f325f898a293minfrin <p><directive>CacheIgnoreHeaders</directive> takes a space separated list
2af38cc44e48753913565b38a7a9f325f898a293minfrin of HTTP headers that should not be stored in the cache. If only hop-by-hop
2af38cc44e48753913565b38a7a9f325f898a293minfrin headers not should be stored in the cache (the RFC 2616 compliant
8d36abdf61277cb8ffcecc763c8a86c28f11f8e9covener behaviour), <directive>CacheIgnoreHeaders</directive> can be set to
da7952dfad53cb6344b3fd2128241d3f9c6ed6cbcovener <code>None</code>.</p>
b4f25203520c168e2df9f7d83024db09e68efe7ecovener
8d36abdf61277cb8ffcecc763c8a86c28f11f8e9covener <example><title>Example 1</title>
15f37a157fbbf107658ed82ec30c348a9b6e518end CacheIgnoreHeaders Set-Cookie
8d36abdf61277cb8ffcecc763c8a86c28f11f8e9covener </example>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard <example><title>Example 2</title>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard CacheIgnoreHeaders None
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard </example>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin <note type="warning"><title>Warning:</title>
15f37a157fbbf107658ed82ec30c348a9b6e518end If headers like <code>Expires</code> which are needed for proper cache
15f37a157fbbf107658ed82ec30c348a9b6e518end management are not stored due to a
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard <directive>CacheIgnoreHeaders</directive> setting, the behaviour of
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard mod_cache is undefined.
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard </note>
15f37a157fbbf107658ed82ec30c348a9b6e518end</usage>
15f37a157fbbf107658ed82ec30c348a9b6e518end</directivesynopsis>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard
15f37a157fbbf107658ed82ec30c348a9b6e518end<directivesynopsis>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj<name>CacheStorePrivate</name>
15f37a157fbbf107658ed82ec30c348a9b6e518end<description>Attempt to cache responses that the server has marked as private</description>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard<syntax>CacheStorePrivate On|Off</syntax>
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin<default>CacheStorePrivate Off</default>
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin<contextlist><context>server config</context><context>virtual host</context>
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin</contextlist>
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin<usage>
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin <p>Ordinarily, responses with Cache-Control: private header values will not
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin be stored in the cache. The <directive>CacheStorePrivate</directive>
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin directive allows this behavior to be overridden.
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin <directive>CacheStorePrivate</directive> On
ed6dfb7d7057dc4f42348f12d7bff9fe98fc73cfminfrin tells the server to attempt to cache the resource even if it contains
8d36abdf61277cb8ffcecc763c8a86c28f11f8e9covener private header values. Resources requiring authorization will
da7952dfad53cb6344b3fd2128241d3f9c6ed6cbcovener <em>never</em> be cached.</p>
b4f25203520c168e2df9f7d83024db09e68efe7ecovener
da7952dfad53cb6344b3fd2128241d3f9c6ed6cbcovener <example>
8d36abdf61277cb8ffcecc763c8a86c28f11f8e9covener CacheStorePrivate On
8d36abdf61277cb8ffcecc763c8a86c28f11f8e9covener </example>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard <note type="warning"><title>Warning:</title>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard This directive will allow caching even if the upstream server has
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard requested that the resource not be cached. This directive is only
15f37a157fbbf107658ed82ec30c348a9b6e518end ideal for a 'private' cache.
88c775368960b64afcdfd93a812f466a109746baerikabele </note>
4cefc38158672f5de8119886d9754cf0609a9371minfrin</usage>
4cefc38158672f5de8119886d9754cf0609a9371minfrin<seealso><directive module="mod_cache">CacheIgnoreCacheControl</directive></seealso>
4cefc38158672f5de8119886d9754cf0609a9371minfrin<seealso><directive module="mod_cache">CacheStoreNoStore</directive></seealso>
4cefc38158672f5de8119886d9754cf0609a9371minfrin</directivesynopsis>
15f37a157fbbf107658ed82ec30c348a9b6e518end
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard<directivesynopsis>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard<name>CacheStoreNoStore</name>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj<description>Attempt to cache requests or responses that have been marked as no-store.</description>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj<syntax>CacheStoreNoStore On|Off</syntax>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj<default>CacheStoreNoStore Off</default>
62e52789bfc10a5fd0a433af77e77c8ebbbed6c2rederpj<contextlist><context>server config</context><context>virtual host</context>
15f37a157fbbf107658ed82ec30c348a9b6e518end</contextlist>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard
15f37a157fbbf107658ed82ec30c348a9b6e518end<usage>
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard <p>Ordinarily, requests or responses with Cache-Control: no-store header
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard values will not be stored in the cache. The
721fdd19e2abef2e8dc46eb5c022ef14efe3367estoddard <directive>CacheStoreNoCache</directive> directive allows this
15f37a157fbbf107658ed82ec30c348a9b6e518end behavior to be overridden. <directive>CacheStoreNoCache</directive> On
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem tells the server to attempt to cache the resource even if it contains
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem no-store header values. Resources requiring authorization will
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem <em>never</em> be cached.</p>
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem <example>
4cefc38158672f5de8119886d9754cf0609a9371minfrin CacheStoreNoStore On
4cefc38158672f5de8119886d9754cf0609a9371minfrin </example>
4cefc38158672f5de8119886d9754cf0609a9371minfrin
4cefc38158672f5de8119886d9754cf0609a9371minfrin <note type="warning"><title>Warning:</title>
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem As described in RFC 2616, the no-store directive is intended to
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem "prevent the inadvertent release or retention of sensitive information
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem (for example, on backup tapes)." Enabling this option could store
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem sensitive information in the cache. You are hereby warned.
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem </note>
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem</usage>
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem<seealso><directive module="mod_cache">CacheIgnoreCacheControl</directive></seealso>
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem<seealso><directive module="mod_cache">CacheStorePrivate</directive></seealso>
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem</directivesynopsis>
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem</modulesynopsis>
1b0dce86d7fc8a5aa4c89b05255be26e508c615crpluem