1<?xml version="1.0" encoding="ISO-8859-1"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!-- 4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 5 This file is generated from xml source: DO NOT EDIT 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 --> 8<title>mod_disk_cache - Apache HTTP Server</title> 9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 11<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" /> 12<script src="/style/scripts/prettify.js" type="text/javascript"> 13</script> 14 15<link href="/images/favicon.ico" rel="shortcut icon" /></head> 16<body> 17<div id="page-header"> 18<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p> 19<p class="apache">Apache HTTP Server Version 2.2</p> 20<img alt="" src="/images/feather.gif" /></div> 21<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 22<div id="path"> 23<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.2</a> > <a href="./">Modules</a></div> 24<div id="page-content"> 25<div id="preamble"><h1>Apache Module mod_disk_cache</h1> 26<div class="toplang"> 27<p><span>Available Languages: </span><a href="/en/mod/mod_disk_cache.html" title="English"> en </a> | 28<a href="/ja/mod/mod_disk_cache.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | 29<a href="/ko/mod/mod_disk_cache.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p> 30</div> 31<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Content cache storage manager keyed to URIs</td></tr> 32<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr> 33<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>disk_cache_module</td></tr> 34<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_disk_cache.c</td></tr></table> 35<h3>Summary</h3> 36 37 <p><code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code> implements a disk based storage 38 manager. It is primarily of use in conjunction with 39 <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code>.</p> 40 41 <p>Content is stored in and retrieved from the cache using URI based 42 keys. Content with access protection is not cached.</p> 43 44 <p><code class="program"><a href="/programs/htcacheclean.html">htcacheclean</a></code> can be used to maintain the cache 45 size at a maximum level.</p> 46 47 <div class="note"><h3>Note:</h3> 48 <p><code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code> requires the services of 49 <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code>.</p> 50 </div> 51 <div class="note"><h3>Note:</h3> 52 <p><code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code> uses the sendfile feature to 53 serve files from the cache when supported by the platform, and 54 when enabled with <code class="directive"><a href="/mod/core.html#enablesendfile">EnableSendfile</a></code>. 55 However, per-directory and .htaccess configuration of 56 <code class="directive"><a href="/mod/core.html#enablesendfile">EnableSendfile</a></code> are ignored by 57 <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code> as the corresponding settings are not 58 available to the module when a request is being served from the 59 cache.</p> 60 </div> 61</div> 62<div id="quickview"><h3 class="directives">Directives</h3> 63<ul id="toc"> 64<li><img alt="" src="/images/down.gif" /> <a href="#cachedirlength">CacheDirLength</a></li> 65<li><img alt="" src="/images/down.gif" /> <a href="#cachedirlevels">CacheDirLevels</a></li> 66<li><img alt="" src="/images/down.gif" /> <a href="#cachemaxfilesize">CacheMaxFileSize</a></li> 67<li><img alt="" src="/images/down.gif" /> <a href="#cacheminfilesize">CacheMinFileSize</a></li> 68<li><img alt="" src="/images/down.gif" /> <a href="#cacheroot">CacheRoot</a></li> 69</ul> 70<ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> 71 72<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 73<div class="directive-section"><h2><a name="CacheDirLength" id="CacheDirLength">CacheDirLength</a> <a name="cachedirlength" id="cachedirlength">Directive</a></h2> 74<table class="directive"> 75<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The number of characters in subdirectory names</td></tr> 76<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheDirLength <var>length</var></code></td></tr> 77<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheDirLength 2</code></td></tr> 78<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> 79<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> 80<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_disk_cache</td></tr> 81</table> 82 <p>The <code class="directive">CacheDirLength</code> directive sets the number 83 of characters for each subdirectory name in the cache hierarchy.</p> 84 85 <div class="note"> 86 <p>The result of <code class="directive"><a href="#cachedirlevels">CacheDirLevels</a></code>* <code class="directive">CacheDirLength</code> 87 must not be higher than 20.</p> 88 </div> 89 90 <div class="example"><p><code> 91 CacheDirLength 4 92 </code></p></div> 93 94</div> 95<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 96<div class="directive-section"><h2><a name="CacheDirLevels" id="CacheDirLevels">CacheDirLevels</a> <a name="cachedirlevels" id="cachedirlevels">Directive</a></h2> 97<table class="directive"> 98<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The number of levels of subdirectories in the 99cache.</td></tr> 100<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheDirLevels <var>levels</var></code></td></tr> 101<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheDirLevels 3</code></td></tr> 102<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> 103<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> 104<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_disk_cache</td></tr> 105</table> 106 <p>The <code class="directive">CacheDirLevels</code> directive sets the number 107 of subdirectory levels in the cache. Cached data will be saved this 108 many directory levels below the <code class="directive"><a href="#cacheroot">CacheRoot</a></code> directory.</p> 109 110 <div class="note"> 111 <p>The result of <code class="directive">CacheDirLevels</code>* 112 <code class="directive"><a href="#cachedirlength">CacheDirLength</a></code> must 113 not be higher than 20.</p> 114 </div> 115 116 <div class="example"><p><code> 117 CacheDirLevels 5 118 </code></p></div> 119 120</div> 121<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 122<div class="directive-section"><h2><a name="CacheMaxFileSize" id="CacheMaxFileSize">CacheMaxFileSize</a> <a name="cachemaxfilesize" id="cachemaxfilesize">Directive</a></h2> 123<table class="directive"> 124<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The maximum size (in bytes) of a document to be placed in the 125cache</td></tr> 126<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheMaxFileSize <var>bytes</var></code></td></tr> 127<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheMaxFileSize 1000000</code></td></tr> 128<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> 129<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> 130<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_disk_cache</td></tr> 131</table> 132 <p>The <code class="directive">CacheMaxFileSize</code> directive sets the 133 maximum size, in bytes, for a document to be considered for storage in 134 the cache.</p> 135 136 <div class="example"><p><code> 137 CacheMaxFileSize 64000 138 </code></p></div> 139 140</div> 141<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 142<div class="directive-section"><h2><a name="CacheMinFileSize" id="CacheMinFileSize">CacheMinFileSize</a> <a name="cacheminfilesize" id="cacheminfilesize">Directive</a></h2> 143<table class="directive"> 144<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The minimum size (in bytes) of a document to be placed in the 145cache</td></tr> 146<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheMinFileSize <var>bytes</var></code></td></tr> 147<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheMinFileSize 1</code></td></tr> 148<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> 149<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> 150<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_disk_cache</td></tr> 151</table> 152 <p>The <code class="directive">CacheMinFileSize</code> directive sets the 153 minimum size, in bytes, for a document to be considered for storage 154 in the cache.</p> 155 156 <div class="example"><p><code> 157 CacheMinFileSize 64 158 </code></p></div> 159 160</div> 161<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 162<div class="directive-section"><h2><a name="CacheRoot" id="CacheRoot">CacheRoot</a> <a name="cacheroot" id="cacheroot">Directive</a></h2> 163<table class="directive"> 164<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The directory root under which cache files are 165stored</td></tr> 166<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheRoot <var>directory</var></code></td></tr> 167<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> 168<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> 169<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_disk_cache</td></tr> 170</table> 171 <p>The <code class="directive">CacheRoot</code> directive defines the name of 172 the directory on the disk to contain cache files. If the <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code> module has been loaded or compiled in to the 173 Apache server, this directive <em>must</em> be defined. Failing to 174 provide a value for <code class="directive">CacheRoot</code> will result in 175 a configuration file processing error. The <code class="directive"><a href="#cachedirlevels">CacheDirLevels</a></code> and <code class="directive"><a href="#cachedirlength">CacheDirLength</a></code> directives define 176 the structure of the directories under the specified root directory.</p> 177 178 <div class="example"><p><code> 179 CacheRoot c:/cacheroot 180 </code></p></div> 181 182</div> 183</div> 184<div class="bottomlang"> 185<p><span>Available Languages: </span><a href="/en/mod/mod_disk_cache.html" title="English"> en </a> | 186<a href="/ja/mod/mod_disk_cache.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | 187<a href="/ko/mod/mod_disk_cache.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p> 188</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> 189<script type="text/javascript"><!--//--><![CDATA[//><!-- 190var comments_shortname = 'httpd'; 191var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_disk_cache.html'; 192(function(w, d) { 193 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 194 d.write('<div id="comments_thread"><\/div>'); 195 var s = d.createElement('script'); 196 s.type = 'text/javascript'; 197 s.async = true; 198 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 199 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 200 } 201 else { 202 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 203 } 204})(window, document); 205//--><!]]></script></div><div id="footer"> 206<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> 207<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- 208if (typeof(prettyPrint) !== 'undefined') { 209 prettyPrint(); 210} 211//--><!]]></script> 212</body></html>