]> granicus.if.org Git - apache/blob - docs/manual/socache.html.en
Update transformations.
[apache] / docs / manual / socache.html.en
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>Shared Object Cache in Apache HTTP Server - 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" />
12 <link href="./images/favicon.ico" rel="shortcut icon" /></head>
13 <body id="manual-page" class="no-sidebar"><div id="page-header">
14 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="./faq/">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p>
15 <p class="apache">Apache HTTP Server Version 2.5</p>
16 <img alt="" src="./images/feather.gif" /></div>
17 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="./images/left.gif" /></a></div>
18 <div id="path">
19 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="./">Version 2.5</a></div><div id="page-content"><div id="preamble"><h1>Shared Object Cache in Apache HTTP Server</h1>
20 <div class="toplang">
21 <p><span>Available Languages: </span><a href="./en/socache.html" title="English">&nbsp;en&nbsp;</a></p>
22 </div>
23
24     <p>The Shared Object Cache provides a means to share simple data
25     across all a server's workers, regardless of <a href="mpm.html">thread
26     and process models</a>.  It is used where the advantages of sharing
27     data across processes outweigh the performance overhead of
28     inter-process communication.</p>
29   </div>
30 <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
31 <div class="section">
32 <h2><a name="providers" id="providers">Shared Object Cache Providers</a></h2>
33     
34     <p>The shared object cache as such is an abstraction.  Four different
35     modules implement it.  To use the cache, one or more of these modules
36     must be present, and configured.</p>
37     <p>The only configuration required is to select which cache provider
38     to use.  This is the responsibility of modules using the cache, and
39     they enable selection using directives such as
40     <code class="directive"><a href="./mod/mod_cache_socache.html#cachesocache">CacheSocache</a></code>,
41     <code class="directive"><a href="./mod/mod_authn_socache.html#authncachesocache">AuthnCacheSOCache</a></code>,
42     <code class="directive"><a href="./mod/mod_ssl.html#sslsessioncache">SSLSessionCache</a></code>, and
43     <code class="directive"><a href="./mod/mod_ssl.html#sslstaplingcache">SSLStaplingCache</a></code>.</p>
44     <p>Currently available providers are:</p>
45     <dl>
46     <dt>"dbm" (<code class="module"><a href="./mod/mod_socache_dbm.html">mod_socache_dbm</a></code>)</dt>
47     <dd>This makes use of a DBM hash file.
48      The choice of underlying DBM used may be configurable
49      if the installed APR version supports multiple DBM implementations.</dd>
50     <dt>"dc" (<code class="module"><a href="./mod/mod_socache_dc.html">mod_socache_dc</a></code>)</dt>
51     <dd>This makes use of the <a href="http://www.distcache.org/">distcache</a>
52     distributed session caching libraries.</dd>
53     <dt>"memcache" (<code class="module"><a href="./mod/mod_socache_memcache.html">mod_socache_memcache</a></code>)</dt>
54     <dd>This makes use of the <a href="http://memcached.org/">memcached</a>
55     high-performance, distributed memory object caching system.</dd>
56     <dt>"shmcb" (<code class="module"><a href="./mod/mod_socache_shmcb.html">mod_socache_shmcb</a></code>)</dt>
57     <dd>This makes use of a high-performance cyclic buffer inside a
58      shared memory segment.</dd>
59     </dl>
60
61     <p>The API provides the following functions:</p>
62
63     <dl>
64       <dt>const char *create(ap_socache_instance_t **instance, const char *arg,
65                           apr_pool_t *tmp, apr_pool_t *p);</dt>
66       <dd>Create a session cache based on the given configuration string.
67       The instance pointer returned in the instance paramater will be
68       passed as the first argument to subsequent invocations.</dd>
69
70       <dt>apr_status_t init(ap_socache_instance_t *instance, const char *cname,
71                          const struct ap_socache_hints *hints,
72                          server_rec *s, apr_pool_t *pool)</dt>
73       <dd>Initialize the cache.  The cname must be of maximum length 16
74       characters, and uniquely identifies the consumer of the cache
75       within the server; using the module name is recommended, e.g.
76       "mod_ssl-sess".  This string may be used within a filesystem
77       path so use of only alphanumeric [a-z0-9_-] characters is
78       recommended.  If hints is non-NULL, it gives a set of hints for
79       the provider.  Return APR error code.</dd>
80
81       <dt>void destroy(ap_socache_instance_t *instance, server_rec *s)</dt>
82       <dd>Destroy a given cache instance object.</dd>
83
84       <dt>apr_status_t store(ap_socache_instance_t *instance, server_rec *s,
85                           const unsigned char *id, unsigned int idlen,
86                           apr_time_t expiry,
87                           unsigned char *data, unsigned int datalen,
88                           apr_pool_t *pool)</dt>
89       <dd>Store an object in a cache instance.</dd>
90
91       <dt>apr_status_t retrieve(ap_socache_instance_t *instance, server_rec *s,
92                              const unsigned char *id, unsigned int idlen,
93                              unsigned char *data, unsigned int *datalen,
94                              apr_pool_t *pool)</dt>
95       <dd>Retrieve a cached object.</dd>
96
97       <dt>apr_status_t remove(ap_socache_instance_t *instance, server_rec *s,
98                            const unsigned char *id, unsigned int idlen,
99                            apr_pool_t *pool)</dt>
100       <dd>Remove an object from the cache.</dd>
101
102       <dt>void status(ap_socache_instance_t *instance, request_rec *r, int flags)</dt>
103       <dd>Dump the status of a cache instance for mod_status.</dd>
104
105       <dt>apr_status_t iterate(ap_socache_instance_t *instance, server_rec *s,
106                             void *userctx, ap_socache_iterator_t *iterator,
107                             apr_pool_t *pool)</dt>
108       <dd>Dump all cached objects through an iterator callback.</dd>
109     </dl>
110
111   </div></div>
112 <div class="bottomlang">
113 <p><span>Available Languages: </span><a href="./en/socache.html" title="English">&nbsp;en&nbsp;</a></p>
114 </div><div id="footer">
115 <p class="apache">Copyright 2012 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>
116 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="./faq/">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p></div>
117 </body></html>