summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/mod_cache.html
blob: b595d53ca2cef8220016673622fceb529ab578c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!-- 
          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                This file is generated from xml source: DO NOT EDIT
          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        --><title>mod_cache- Apache HTTP Server</title><link rel="stylesheet" type="text/css" href="../style/manual.css"/></head><body><blockquote><div align="center"><img src="../images/sub.gif" alt="[APACHE DOCUMENTATION]"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_cache</h1><table bgcolor="#cccccc" cellpadding="0" cellspacing="1"><tr><td><table bgcolor="#ffffff"><tr><td valign="top"><span class="help">Description:</span></td><td>Content cache keyed to URIs</td></tr><tr><td><a class="help" href="module-dict.html#Status">Status:</a></td><td>Experimental</td></tr><tr><td><a class="help" href="module-dict.html#ModuleIdentifier">Module&nbsp;Identifier:</a></td><td>cache_module</td></tr></table></td></tr></table><h2>Summary</h2>

<blockquote><table><tr><td bgcolor="#ffe5f5">
This module is experimental. Documentation is still under development...
</td></tr></table></blockquote>
    <p>mod_cache implements an RFC 2616 compliant HTTP content
    cache that can be used to cache either local or proxied content.
    mod_cache requires the services of one or more storage
    management modules. Two storage management modules are included in
    the base Apache distribution:</p>
    <dl>
    <dt><em>mod_disk_cache</em></dt>
    <dd>implements a disk based storage manager for use with mod_proxy</dd>
    <dt><em>mod_mem_cache</em></dt>
    <dd>implements an in-memory based storage manager. mod_mem_cache
    can be configured to operate in two modes: caching open file
    descriptors or caching objects in heap storage. <em>mod_mem_cache</em>
    is most useful when used to cache locally generated content or to cache 
    backend server content for mod_proxy configured for ProxyPass (aka <em>reverse proxy</em>)</dd>
    </dl>
    <p>Content stored and retrived keyed to the URL. Content with
    access protections is not cached.</p>
<h2>Directives</h2><ul><li><a href="#cachedefaultexpire">CacheDefaultExpire</a></li><li><a href="#cachedisable">CacheDisable</a></li><li><a href="#cacheenable">CacheEnable</a></li><li><a href="#cacheignorecachecontrol">CacheIgnoreCacheControl</a></li><li><a href="#cacheignorenolastmod">CacheIgnoreNoLastMod</a></li><li><a href="#cachelastmodifiedfactor">CacheLastModifiedFactor</a></li><li><a href="#cachemaxexpire">CacheMaxExpire</a></li><li><a href="#cacheon">CacheOn</a></li></ul><h2>Sample Configuration</h2>

<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><p align="center"><strong>Sample httpd.conf</strong></p><code>

# <br/>
# Sample Cache Configuration  <br/>
# <br/>
LoadModule cache_module modules/mod_cache.so  <br/>
&lt;IfModule mod_cache.c&gt;<br/>
   CacheOn On<br/>
<p/>
   #LoadModule disk_cache_module modules/mod_disk_cache.so <br/>
   &lt;IfModule mod_disk_cache.c&gt; <br/>
      CacheRoot c:/cacheroot <br/>
      CacheSize 
      CacheEnable disk  / <br/>
      CacheDirLevels 5 <br/>
      CacheDirLength 3 <br/>
   &lt;/IfModule&gt; <br/>
<p/>
   LoadModule mem_cache_module modules/mod_mem_cache.so <br/>
   &lt;IfModule mod_mem_cache.c&gt; <br/>
      MCacheEnable mem  / <br/>
      MCacheSize 4096 <br/>
      MCacheMaxObjectCount 100 <br/>
      MCacheMinObjectSize 1 <br/>
      MCacheMaxObjectSize 2048 <br/>
   &lt;/IfModule&gt; <br/>
<p/>
&lt;/IfModule&gt; <br/>

</code></td></tr></table></blockquote>

<hr/><h2><a name="CacheDefaultExpire">CacheDefaultExpire</a> <a name="cachedefaultexpire">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Experimental</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_cache</td></tr></table></td></tr></table>
    <p>The default time in seconds to cache a document.</p>
    <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
    CacheDefaultExpire 86400
    </code></td></tr></table></blockquote>
<hr/><h2><a name="CacheDisable">CacheDisable</a> <a name="cachedisable">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Disable caching of specified URLs by specified storage manager</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>CacheDisable <em>cache_type </em> <em> url-string</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Experimental</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_cache</td></tr></table></td></tr></table>
    <p>The <code class="directive">CacheDisable</code> directive instructs
    mod_cache to <em>not</em> cache urls at or above <em>url-string</em>.</p>

<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><p align="center"><strong>Example</strong></p><code>
  CacheDisable disk /local_files
</code></td></tr></table></blockquote>
<hr/><h2><a name="CacheEnable">CacheEnable</a> <a name="cacheenable">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Enable caching specified URLs in a specified storage manager</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>CacheEnable <em>cache_type </em><em> url-string</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Experimental</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_cache</td></tr></table></td></tr></table>
    <p>The <code class="directive">CacheEnable</code> directive instructs
    mod_cache to cache urls at or below <em>url-string</em>.  
    The cache store is specified with the <em>cache_type</em> argument.
    <em>cache_type </em> <em> mem</em> instructs mod_cache to use the
    in-memory cache storage manager implemented by <em>mod_mem_cache</em>. 
    <em>cache_type </em> <em> disk</em> instructs mod_cache to use the
    cache storage manager implemented by <em>mod_disk_cache </em>. </p>

<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
  CacheEnable  disk  / <br/>
  CacheEnable  mem   /manual <br/>
  CacheEnable  fd    /images <br/>
</code></td></tr></table></blockquote>
<hr/><h2><a name="CacheIgnoreCacheControl">CacheIgnoreCacheControl</a> <a name="cacheignorecachecontrol">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Ignore requests from the client for uncached content</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Experimental</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_cache</td></tr></table></td></tr></table>
    <p>Ignore requests from the client for uncached content</p>

    <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
    CacheIgnoreNoLastMod 
    </code></td></tr></table></blockquote>
<hr/><h2><a name="CacheIgnoreNoLastMod">CacheIgnoreNoLastMod</a> <a name="cacheignorenolastmod">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Ignore responses where there is no Last Modified Header</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Experimental</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_cache</td></tr></table></td></tr></table>
    <p>Ignore responses where there is no Last Modified Header</p>

    <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
    CacheIgnoreNoLastMod 
    </code></td></tr></table></blockquote>
<hr/><h2><a name="CacheLastModifiedFactor">CacheLastModifiedFactor</a> <a name="cachelastmodifiedfactor">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>The factor used to estimate the Expires date from the LastModified date</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Experimental</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_cache</td></tr></table></td></tr></table>
    <p>The factor used to estimate the Expires date from the LastModified date.</p>

    <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
    CacheLastModifiedFactor  
    </code></td></tr></table></blockquote>
<hr/><h2><a name="CacheMaxExpire">CacheMaxExpire</a> <a name="cachemaxexpire">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>The maximum time in seconds to cache a document</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Experimental</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_cache</td></tr></table></td></tr></table>
    <p>The maximum time in seconds to cache a document.</p>
    <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
    CacheMaxExpire 604800
    </code></td></tr></table></blockquote>
<hr/><h2><a name="CacheOn">CacheOn</a> <a name="cacheon">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>CacheOn</td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Experimental</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_cache</td></tr></table></td></tr></table>
    <p>
    </p>


<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
  CacheOn
</code></td></tr></table></blockquote>
<hr/></blockquote><h3 align="center">Apache HTTP Server Version 2.0</h3><a href="./"><img src="../images/index.gif" alt="Index"/></a><a href="../"><img src="../images/home.gif" alt="Home"/></a></body></html>