]> granicus.if.org Git - apache/blob - docs/manual/socache.html.en
Update XForms.
[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 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
5 <!--
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7               This file is generated from xml source: DO NOT EDIT
8         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9       -->
10 <title>Shared Object Cache in Apache HTTP Server - Apache HTTP Server Version 2.5</title>
11 <link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
12 <link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
13 <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" />
14 <script src="./style/scripts/prettify.min.js" type="text/javascript">
15 </script>
16
17 <link href="./images/favicon.ico" rel="shortcut icon" /></head>
18 <body id="manual-page" class="no-sidebar"><div id="page-header">
19 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/quickreference.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>
20 <p class="apache">Apache HTTP Server Version 2.5</p>
21 <img alt="" src="./images/feather.gif" /></div>
22 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="./images/left.gif" /></a></div>
23 <div id="path">
24 <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>
25 <div class="toplang">
26 <p><span>Available Languages: </span><a href="./en/socache.html" title="English">&nbsp;en&nbsp;</a> |
27 <a href="./fr/socache.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a></p>
28 </div>
29
30     <p>The Shared Object Cache provides a means to share simple data
31     across all a server's workers, regardless of <a href="mpm.html">thread
32     and process models</a>.  It is used where the advantages of sharing
33     data across processes outweigh the performance overhead of
34     inter-process communication.</p>
35   </div>
36 <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
37 <div class="section">
38 <h2><a name="providers" id="providers">Shared Object Cache Providers</a></h2>
39     
40     <p>The shared object cache as such is an abstraction.  Four different
41     modules implement it.  To use the cache, one or more of these modules
42     must be present, and configured.</p>
43     <p>The only configuration required is to select which cache provider
44     to use.  This is the responsibility of modules using the cache, and
45     they enable selection using directives such as
46     <code class="directive"><a href="./mod/mod_cache_socache.html#cachesocache">CacheSocache</a></code>,
47     <code class="directive"><a href="./mod/mod_authn_socache.html#authncachesocache">AuthnCacheSOCache</a></code>,
48     <code class="directive"><a href="./mod/mod_ssl.html#sslsessioncache">SSLSessionCache</a></code>, and
49     <code class="directive"><a href="./mod/mod_ssl.html#sslstaplingcache">SSLStaplingCache</a></code>.</p>
50     <p>Currently available providers are:</p>
51     <dl>
52     <dt>"dbm" (<code class="module"><a href="./mod/mod_socache_dbm.html">mod_socache_dbm</a></code>)</dt>
53     <dd>This makes use of a DBM hash file.
54      The choice of underlying DBM used may be configurable
55      if the installed APR version supports multiple DBM implementations.</dd>
56     <dt>"dc" (<code class="module"><a href="./mod/mod_socache_dc.html">mod_socache_dc</a></code>)</dt>
57     <dd>This makes use of the <a href="http://www.distcache.org/">distcache</a>
58     distributed session caching libraries.</dd>
59     <dt>"memcache" (<code class="module"><a href="./mod/mod_socache_memcache.html">mod_socache_memcache</a></code>)</dt>
60     <dd>This makes use of the <a href="http://memcached.org/">memcached</a>
61     high-performance, distributed memory object caching system.</dd>
62     <dt>"shmcb" (<code class="module"><a href="./mod/mod_socache_shmcb.html">mod_socache_shmcb</a></code>)</dt>
63     <dd>This makes use of a high-performance cyclic buffer inside a
64      shared memory segment.</dd>
65     </dl>
66
67     <p>The API provides the following functions:</p>
68
69     <dl>
70       <dt>const char *create(ap_socache_instance_t **instance, const char *arg,
71                           apr_pool_t *tmp, apr_pool_t *p);</dt>
72       <dd>Create a session cache based on the given configuration string.
73       The instance pointer returned in the instance paramater will be
74       passed as the first argument to subsequent invocations.</dd>
75
76       <dt>apr_status_t init(ap_socache_instance_t *instance, const char *cname,
77                          const struct ap_socache_hints *hints,
78                          server_rec *s, apr_pool_t *pool)</dt>
79       <dd>Initialize the cache.  The cname must be of maximum length 16
80       characters, and uniquely identifies the consumer of the cache
81       within the server; using the module name is recommended, e.g.
82       "mod_ssl-sess".  This string may be used within a filesystem
83       path so use of only alphanumeric [a-z0-9_-] characters is
84       recommended.  If hints is non-NULL, it gives a set of hints for
85       the provider.  Return APR error code.</dd>
86
87       <dt>void destroy(ap_socache_instance_t *instance, server_rec *s)</dt>
88       <dd>Destroy a given cache instance object.</dd>
89
90       <dt>apr_status_t store(ap_socache_instance_t *instance, server_rec *s,
91                           const unsigned char *id, unsigned int idlen,
92                           apr_time_t expiry,
93                           unsigned char *data, unsigned int datalen,
94                           apr_pool_t *pool)</dt>
95       <dd>Store an object in a cache instance.</dd>
96
97       <dt>apr_status_t retrieve(ap_socache_instance_t *instance, server_rec *s,
98                              const unsigned char *id, unsigned int idlen,
99                              unsigned char *data, unsigned int *datalen,
100                              apr_pool_t *pool)</dt>
101       <dd>Retrieve a cached object.</dd>
102
103       <dt>apr_status_t remove(ap_socache_instance_t *instance, server_rec *s,
104                            const unsigned char *id, unsigned int idlen,
105                            apr_pool_t *pool)</dt>
106       <dd>Remove an object from the cache.</dd>
107
108       <dt>void status(ap_socache_instance_t *instance, request_rec *r, int flags)</dt>
109       <dd>Dump the status of a cache instance for mod_status.</dd>
110
111       <dt>apr_status_t iterate(ap_socache_instance_t *instance, server_rec *s,
112                             void *userctx, ap_socache_iterator_t *iterator,
113                             apr_pool_t *pool)</dt>
114       <dd>Dump all cached objects through an iterator callback.</dd>
115     </dl>
116
117   </div></div>
118 <div class="bottomlang">
119 <p><span>Available Languages: </span><a href="./en/socache.html" title="English">&nbsp;en&nbsp;</a> |
120 <a href="./fr/socache.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a></p>
121 </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&amp;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>
122 <script type="text/javascript"><!--//--><![CDATA[//><!--
123 var comments_shortname = 'httpd';
124 var comments_identifier = 'http://httpd.apache.org/docs/trunk/socache.html';
125 (function(w, d) {
126     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
127         d.write('<div id="comments_thread"><\/div>');
128         var s = d.createElement('script');
129         s.type = 'text/javascript';
130         s.async = true;
131         s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
132         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
133     }
134     else {
135         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
136     }
137 })(window, document);
138 //--><!]]></script></div><div id="footer">
139 <p class="apache">Copyright 2016 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>
140 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/quickreference.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[//><!--
141 if (typeof(prettyPrint) !== 'undefined') {
142     prettyPrint();
143 }
144 //--><!]]></script>
145 </body></html>