2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="mod_cache_socache.xml.meta">
25 <name>mod_cache_socache</name>
26 <description>Shared object cache (socache) based storage module for the
27 HTTP caching filter.</description>
28 <status>Extension</status>
29 <sourcefile>mod_cache_socache.c</sourcefile>
30 <identifier>cache_socache_module</identifier>
33 <p><module>mod_cache_socache</module> implements a shared object cache
34 (socache) based storage manager for <module>mod_cache</module>.</p>
36 <p>The headers and bodies of cached responses are combined, and stored
37 underneath a single key in the shared object cache. A
38 <a href="../socache.html">number of implementations</a> of shared object
39 caches are available to choose from.</p>
41 <p>Multiple content negotiated responses can be stored concurrently,
42 however the caching of partial content is not yet supported by this
45 <highlight language="config">
48 CacheSocacheMaxSize 102400
53 # Fall back to the disk cache
55 CacheSocacheMaxSize 102400
62 <note><title>Note:</title>
63 <p><module>mod_cache_socache</module> requires the services of
64 <module>mod_cache</module>, which must be loaded before
65 mod_cache_socache.</p>
68 <seealso><module>mod_cache</module></seealso>
69 <seealso><module>mod_cache_disk</module></seealso>
70 <seealso><a href="../caching.html">Caching Guide</a></seealso>
73 <name>CacheSocache</name>
74 <description>The directory root under which cache files are
76 <syntax>CacheSocache <var>type[:args]</var></syntax>
77 <contextlist><context>server config</context><context>virtual host</context>
79 <compatibility>Available in Apache 2.5 and later</compatibility>
82 <p>The <directive>CacheSocache</directive> directive defines the name of
83 the shared object cache implementation to use, followed by optional
84 arguments for that implementation. A <a href="../socache.html">number of
85 implementations</a> of shared object caches are available to choose
88 <highlight language="config">
95 <name>CacheSocacheMaxTime</name>
96 <description>The maximum time (in seconds) for a document to be placed in the
98 <syntax>CacheSocacheMaxTime <var>seconds</var></syntax>
99 <default>CacheSocacheMaxTime 86400</default>
100 <contextlist><context>server config</context>
101 <context>virtual host</context>
102 <context>directory</context>
103 <context>.htaccess</context>
105 <compatibility>Available in Apache 2.5 and later</compatibility>
108 <p>The <directive>CacheSocacheMaxTime</directive> directive sets the
109 maximum freshness lifetime, in seconds, for a document to be stored in
110 the cache. This value overrides the freshness lifetime defined for the
111 document by the HTTP protocol.</p>
113 <highlight language="config">
114 CacheSocacheMaxTime 86400
120 <name>CacheSocacheMinTime</name>
121 <description>The maximum time (in seconds) for a document to be placed in the
123 <syntax>CacheSocacheMinTime <var>seconds</var></syntax>
124 <default>CacheSocacheMinTime 600</default>
125 <contextlist><context>server config</context>
126 <context>virtual host</context>
127 <context>directory</context>
128 <context>.htaccess</context>
130 <compatibility>Available in Apache 2.5 and later</compatibility>
133 <p>The <directive>CacheSocacheMinTime</directive> directive sets the
134 amount of seconds beyond the freshness lifetime of the response that the
135 response should be cached for in the shared object cache. If a response is
136 only stored for its freshness lifetime, there will be no opportunity to
137 revalidate the response to make it fresh again.</p>
139 <highlight language="config">
140 CacheSocacheMinTime 600
146 <name>CacheSocacheMaxSize</name>
147 <description>The maximum size (in bytes) of an entry to be placed in the
149 <syntax>CacheSocacheMaxSize <var>bytes</var></syntax>
150 <default>CacheSocacheMaxSize 102400</default>
151 <contextlist><context>server config</context>
152 <context>virtual host</context>
153 <context>directory</context>
154 <context>.htaccess</context>
156 <compatibility>Available in Apache 2.5 and later</compatibility>
159 <p>The <directive>CacheSocacheMaxSize</directive> directive sets the
160 maximum size, in bytes, for the combined headers and body of a document
161 to be considered for storage in the cache. The larger the headers that
162 are stored alongside the body, the smaller the body may be.</p>
164 <p>The <module>mod_cache_socache</module> module will only attempt to
165 cache responses that have an explicit content length, or that are small
166 enough to be written in one pass. This is done to allow the
167 <module>mod_cache_disk</module> module to have an opportunity to cache
168 responses larger than those cacheable within
169 <module>mod_cache_socache</module>.</p>
171 <highlight language="config">
172 CacheSocacheMaxSize 102400
178 <name>CacheSocacheReadSize</name>
179 <description>The minimum size (in bytes) of the document to read and be cached
180 before sending the data downstream</description>
181 <syntax>CacheSocacheReadSize <var>bytes</var></syntax>
182 <default>CacheSocacheReadSize 0</default>
183 <contextlist><context>server config</context>
184 <context>virtual host</context>
185 <context>directory</context>
186 <context>.htaccess</context>
188 <compatibility>Available in Apache 2.5 and later</compatibility>
191 <p>The <directive>CacheSocacheReadSize</directive> directive sets the
192 minimum amount of data, in bytes, to be read from the backend before the
193 data is sent to the client. The default of zero causes all data read of
194 any size to be passed downstream to the client immediately as it arrives.
195 Setting this to a higher value causes the disk cache to buffer at least
196 this amount before sending the result to the client. This can improve
197 performance when caching content from a slow reverse proxy.</p>
199 <p>This directive only takes effect when the data is being saved to the
200 cache, as opposed to data being served from the cache.</p>
202 <highlight language="config">
209 <name>CacheSocacheReadTime</name>
210 <description>The minimum time (in milliseconds) that should elapse while reading
211 before data is sent downstream</description>
212 <syntax>CacheSocacheReadTime <var>milliseconds</var></syntax>
213 <default>CacheSocacheReadTime 0</default>
214 <contextlist><context>server config</context>
215 <context>virtual host</context>
216 <context>directory</context>
217 <context>.htaccess</context>
219 <compatibility>Available in Apache 2.5 and later</compatibility>
222 <p>The <directive>CacheSocacheReadTime</directive> directive sets the minimum amount
223 of elapsed time that should pass before making an attempt to send data
224 downstream to the client. During the time period, data will be buffered
225 before sending the result to the client. This can improve performance when
226 caching content from a reverse proxy.</p>
228 <p>The default of zero disables this option.</p>
230 <p>This directive only takes effect when the data is being saved to the
231 cache, as opposed to data being served from the cache. It is recommended
232 that this option be used alongside the
233 <directive module="mod_cache_socache">CacheSocacheReadSize</directive> directive
234 to ensure that the server does not buffer excessively should data arrive faster
237 <highlight language="config">
238 CacheSocacheReadTime 1000