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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
|
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
<!-- $LastChangedRevision$ -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<modulesynopsis metafile="mod_cache_socache.xml.meta">
<name>mod_cache_socache</name>
<description>Shared object cache (socache) based storage module for the
HTTP caching filter.</description>
<status>Extension</status>
<sourcefile>mod_cache_socache.c</sourcefile>
<identifier>cache_socache_module</identifier>
<summary>
<p><module>mod_cache_socache</module> implements a shared object cache
(socache) based storage manager for <module>mod_cache</module>.</p>
<p>The headers and bodies of cached responses are combined, and stored
underneath a single key in the shared object cache. A
<a href="../socache.html">number of implementations</a> of shared object
caches are available to choose from.</p>
<p>Multiple content negotiated responses can be stored concurrently,
however the caching of partial content is not yet supported by this
module.</p>
<highlight language="config">
# Turn on caching
CacheSocache shmcb
CacheSocacheMaxSize 102400
<Location "/foo">
CacheEnable socache
</Location>
# Fall back to the disk cache
CacheSocache shmcb
CacheSocacheMaxSize 102400
<Location "/foo">
CacheEnable socache
CacheEnable disk
</Location>
</highlight>
<note><title>Note:</title>
<p><module>mod_cache_socache</module> requires the services of
<module>mod_cache</module>, which must be loaded before
<module>mod_cache_socache</module>.</p>
</note>
</summary>
<seealso><module>mod_cache</module></seealso>
<seealso><module>mod_cache_disk</module></seealso>
<seealso><a href="../caching.html">Caching Guide</a></seealso>
<directivesynopsis>
<name>CacheSocache</name>
<description>The shared object cache implementation to use</description>
<syntax>CacheSocache <var>type[:args]</var></syntax>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
<compatibility>Available in Apache 2.4.5 and later</compatibility>
<usage>
<p>The <directive>CacheSocache</directive> directive defines the name of
the shared object cache implementation to use, followed by optional
arguments for that implementation. A <a href="../socache.html">number of
implementations</a> of shared object caches are available to choose
from.</p>
<highlight language="config">
CacheSocache shmcb
</highlight>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheSocacheMaxTime</name>
<description>The maximum time (in seconds) for a document to be placed in the
cache</description>
<syntax>CacheSocacheMaxTime <var>seconds</var></syntax>
<default>CacheSocacheMaxTime 86400</default>
<contextlist><context>server config</context>
<context>virtual host</context>
<context>directory</context>
<context>.htaccess</context>
</contextlist>
<compatibility>Available in Apache 2.4.5 and later</compatibility>
<usage>
<p>The <directive>CacheSocacheMaxTime</directive> directive sets the
maximum freshness lifetime, in seconds, for a document to be stored in
the cache. This value overrides the freshness lifetime defined for the
document by the HTTP protocol.</p>
<highlight language="config">
CacheSocacheMaxTime 86400
</highlight>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheSocacheMinTime</name>
<description>The minimum time (in seconds) for a document to be placed in the
cache</description>
<syntax>CacheSocacheMinTime <var>seconds</var></syntax>
<default>CacheSocacheMinTime 600</default>
<contextlist><context>server config</context>
<context>virtual host</context>
<context>directory</context>
<context>.htaccess</context>
</contextlist>
<compatibility>Available in Apache 2.4.5 and later</compatibility>
<usage>
<p>The <directive>CacheSocacheMinTime</directive> directive sets the
amount of seconds beyond the freshness lifetime of the response that the
response should be cached for in the shared object cache. If a response is
only stored for its freshness lifetime, there will be no opportunity to
revalidate the response to make it fresh again.</p>
<highlight language="config">
CacheSocacheMinTime 600
</highlight>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheSocacheMaxSize</name>
<description>The maximum size (in bytes) of an entry to be placed in the
cache</description>
<syntax>CacheSocacheMaxSize <var>bytes</var></syntax>
<default>CacheSocacheMaxSize 102400</default>
<contextlist><context>server config</context>
<context>virtual host</context>
<context>directory</context>
<context>.htaccess</context>
</contextlist>
<compatibility>Available in Apache 2.4.5 and later</compatibility>
<usage>
<p>The <directive>CacheSocacheMaxSize</directive> directive sets the
maximum size, in bytes, for the combined headers and body of a document
to be considered for storage in the cache. The larger the headers that
are stored alongside the body, the smaller the body may be.</p>
<p>The <module>mod_cache_socache</module> module will only attempt to
cache responses that have an explicit content length, or that are small
enough to be written in one pass. This is done to allow the
<module>mod_cache_disk</module> module to have an opportunity to cache
responses larger than those cacheable within
<module>mod_cache_socache</module>.</p>
<highlight language="config">
CacheSocacheMaxSize 102400
</highlight>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheSocacheReadSize</name>
<description>The minimum size (in bytes) of the document to read and be cached
before sending the data downstream</description>
<syntax>CacheSocacheReadSize <var>bytes</var></syntax>
<default>CacheSocacheReadSize 0</default>
<contextlist><context>server config</context>
<context>virtual host</context>
<context>directory</context>
<context>.htaccess</context>
</contextlist>
<compatibility>Available in Apache 2.4.5 and later</compatibility>
<usage>
<p>The <directive>CacheSocacheReadSize</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 slow 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>
<highlight language="config">
CacheSocacheReadSize 102400
</highlight>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CacheSocacheReadTime</name>
<description>The minimum time (in milliseconds) that should elapse while reading
before data is sent downstream</description>
<syntax>CacheSocacheReadTime <var>milliseconds</var></syntax>
<default>CacheSocacheReadTime 0</default>
<contextlist><context>server config</context>
<context>virtual host</context>
<context>directory</context>
<context>.htaccess</context>
</contextlist>
<compatibility>Available in Apache 2.4.5 and later</compatibility>
<usage>
<p>The <directive>CacheSocacheReadTime</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_cache_socache">CacheSocacheReadSize</directive> directive
to ensure that the server does not buffer excessively should data arrive faster
than expected.</p>
<highlight language="config">
CacheSocacheReadTime 1000
</highlight>
</usage>
</directivesynopsis>
</modulesynopsis>
|