mod_disk_cache.xml revision f312a039cc79d35be2dcb8aa20d91b31b9394c9f
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase<?xml version="1.0"?>
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase<!-- $LastChangedRevision$ -->
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase<!--
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase Licensed to the Apache Software Foundation (ASF) under one or more
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase contributor license agreements. See the NOTICE file distributed with
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase this work for additional information regarding copyright ownership.
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase The ASF licenses this file to You under the Apache License, Version 2.0
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase (the "License"); you may not use this file except in compliance with
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase the License. You may obtain a copy of the License at
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa http://www.apache.org/licenses/LICENSE-2.0
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa Unless required by applicable law or agreed to in writing, software
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa distributed under the License is distributed on an "AS IS" BASIS,
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
912a060c45c036ed9cfb0238fd21595a676fb9ffEugen Kuksa See the License for the specific language governing permissions and
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa limitations under the License.
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa-->
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa<modulesynopsis metafile="mod_disk_cache.xml.meta">
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa
912a060c45c036ed9cfb0238fd21595a676fb9ffEugen Kuksa<name>mod_disk_cache</name>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa<description>Disk based storage module for the HTTP caching filter.</description>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa<status>Extension</status>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa<sourcefile>mod_disk_cache.c</sourcefile>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa<identifier>disk_cache_module</identifier>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa<summary>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa <p><module>mod_disk_cache</module> implements a disk based storage
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa manager for <module>mod_cache</module>.</p>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa <p>The headers and bodies of cached responses are stored separately on
912a060c45c036ed9cfb0238fd21595a676fb9ffEugen Kuksa disk, in a directory structure derived from the md5 hash of the cached
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa URL.</p>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa <p>Multiple content negotiated responses can be stored concurrently,
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa however the caching of partial content is not yet supported by this
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa module.</p>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa <p>Atomic cache updates to both header and body files are achieved
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa without the need for locking by storing the device and inode numbers of
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa the body file within the header file. This has the side effect that
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa cache entries manually moved into the cache will be ignored.</p>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa <p>The <program>htcacheclean</program> tool is provided to list cached
912a060c45c036ed9cfb0238fd21595a676fb9ffEugen Kuksa URLs, remove cached URLs, or to maintain the size of the disk cache
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa within size and/or inode limits. The tool can be run on demand, or
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa can be daemonized to offer continuous monitoring of directory sizes.</p>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa <note><title>Note:</title>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa <p><module>mod_disk_cache</module> requires the services of
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa <module>mod_cache</module>.</p>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa </note>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa <note><title>Note:</title>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa <p><module>mod_disk_cache</module> uses the sendfile feature to
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa serve files from the cache when supported by the platform, and
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa when enabled with <directive module="core">EnableSendfile</directive>.
912a060c45c036ed9cfb0238fd21595a676fb9ffEugen Kuksa However, per-directory and .htaccess configuration of
912a060c45c036ed9cfb0238fd21595a676fb9ffEugen Kuksa <directive module="core">EnableSendfile</directive> are ignored by
912a060c45c036ed9cfb0238fd21595a676fb9ffEugen Kuksa <module>mod_disk_cache</module> as the corresponding settings are not
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa available to the module when a request is being served from the
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa cache.</p>
bf6770920cc4668268a53ede98cfec4a84d6f76cEugen Kuksa </note>
77310fe5e78cea8ba8e7f3caaa8ffc2bd372196eEugen Kuksa</summary>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase<directivesynopsis>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase<name>CacheRoot</name>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase<description>The directory root under which cache files are
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehasestored</description>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase<syntax>CacheRoot <var>directory</var></syntax>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase<contextlist><context>server config</context><context>virtual host</context>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase</contextlist>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase<usage>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase <p>The <directive>CacheRoot</directive> directive defines the name of
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase the directory on the disk to contain cache files. If the <module
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase >mod_disk_cache</module> module has been loaded or compiled in to the
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase Apache server, this directive <em>must</em> be defined. Failing to
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase provide a value for <directive>CacheRoot</directive> will result in
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase a configuration file processing error. The <directive
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase module="mod_disk_cache">CacheDirLevels</directive> and <directive
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase module="mod_disk_cache">CacheDirLength</directive> directives define
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase the structure of the directories under the specified root directory.</p>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase <example>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase CacheRoot c:/cacheroot
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase </example>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase</usage>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase</directivesynopsis>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase<directivesynopsis>
6a23d1f9b4ea1b8cdf98676e057e9ae7db82e5d4Tim Reddehase<name>CacheDirLevels</name>
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksa<description>The number of levels of subdirectories in the
c6c01b2a35434c3983e95b00dcf1774a1ad046a8Eugen Kuksacache.</description>
d5b78898eacc41a91f1e2d06c0f07bb9d449431aTim Reddehase<syntax>CacheDirLevels <var>levels</var></syntax>
<default>CacheDirLevels 2</default>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
<usage>
<p>The <directive>CacheDirLevels</directive> directive sets the number
of subdirectory levels in the cache. Cached data will be saved this
many directory levels below the <directive module="mod_disk_cache"
>CacheRoot</directive> directory.</p>
<p>A high value for <directive>CacheDirLevels</directive> combined
with a low value for <directive>CacheDirLength</directive> will result in
a relatively deep hierarchy, with a small number of subdirectories at each
level.</p>
<note>
<p>The result of <directive>CacheDirLevels</directive>*
<directive module="mod_disk_cache">CacheDirLength</directive> must
not be higher than 20.</p>
</note>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheDirLength</name>
<description>The number of characters in subdirectory names</description>
<syntax>CacheDirLength <var>length</var></syntax>
<default>CacheDirLength 2</default>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
<usage>
<p>The <directive>CacheDirLength</directive> directive sets the number
of characters for each subdirectory name in the cache hierarchy. It can
be used in conjunction with <directive>CacheDirLevels</directive> to
determine the approximate structure of your cache hierarchy.</p>
<p>A high value for <directive>CacheDirLength</directive> combined
with a low value for <directive>CacheDirLevels</directive> will result in
a relatively flat hierarchy, with a large number of subdirectories at each
level.</p>
<note>
<p>The result of <directive module="mod_disk_cache"
>CacheDirLevels</directive>* <directive>CacheDirLength</directive>
must not be higher than 20.</p>
</note>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheMinFileSize</name>
<description>The minimum size (in bytes) of a document to be placed in the
cache</description>
<syntax>CacheMinFileSize <var>bytes</var></syntax>
<default>CacheMinFileSize 1</default>
<contextlist><context>server config</context>
<context>virtual host</context>
<context>directory</context>
<context>.htaccess</context>
</contextlist>
<usage>
<p>The <directive>CacheMinFileSize</directive> directive sets the
minimum size, in bytes, for a document to be considered for storage
in the cache.</p>
<example>
CacheMinFileSize 64
</example>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheMaxFileSize</name>
<description>The maximum size (in bytes) of a document to be placed in the
cache</description>
<syntax>CacheMaxFileSize <var>bytes</var></syntax>
<default>CacheMaxFileSize 1000000</default>
<contextlist><context>server config</context>
<context>virtual host</context>
<context>directory</context>
<context>.htaccess</context>
</contextlist>
<usage>
<p>The <directive>CacheMaxFileSize</directive> directive sets the
maximum size, in bytes, for a document to be considered for storage in
the cache.</p>
<example>
CacheMaxFileSize 64000
</example>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheReadSize</name>
<description>The minimum size (in bytes) of the document to read and be cached
before sending the data downstream</description>
<syntax>CacheReadSize <var>bytes</var></syntax>
<default>CacheReadSize 0</default>
<contextlist><context>server config</context>
<context>virtual host</context>
<context>directory</context>
<context>.htaccess</context>
</contextlist>
<usage>
<p>The <directive>CacheReadSize</directive> directive sets the
minimum amount of data, in bytes, to be read from the backend before the
data is sent to the client. The default of zero causes all data read of
any size to be passed downstream to the client immediately as it arrives.
Setting this to a higher value causes the disk cache to buffer at least
this amount before sending the result to the client. This can improve
performance when caching content from a reverse proxy.</p>
<p>This directive only takes effect when the data is being saved to the
cache, as opposed to data being served from the cache.</p>
<example>
CacheReadSize 102400
</example>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheReadTime</name>
<description>The minimum time (in milliseconds) that should elapse while reading
before data is sent downstream</description>
<syntax>CacheReadTime <var>milliseconds</var></syntax>
<default>CacheReadTime 0</default>
<contextlist><context>server config</context>
<context>virtual host</context>
<context>directory</context>
<context>.htaccess</context>
</contextlist>
<usage>
<p>The <directive>CacheReadTime</directive> directive sets the minimum amount
of elapsed time that should pass before making an attempt to send data
downstream to the client. During the time period, data will be buffered
before sending the result to the client. This can improve performance when
caching content from a reverse proxy.</p>
<p>The default of zero disables this option.</p>
<p>This directive only takes effect when the data is being saved to the
cache, as opposed to data being served from the cache. It is recommended
that this option be used alongside the
<directive module="mod_disk_cache">CacheReadSize</directive> directive to
ensure that the server does not buffer excessively should data arrive faster
than expected.</p>
<example>
CacheReadTime 1000
</example>
</usage>
</directivesynopsis>
</modulesynopsis>