No description or website provided.
C Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src added some weak docs in the README, cleaned a few things up, etc. Jul 10, 2007
README just a stub so far, getting the project rolling. Jul 2, 2007 added example code. changed from an array of servers to a hash Jul 4, 2007




mod_memcache may be interesting to you if you are:
1) developing Apache modules, and
2) want to connect to one or more memcached server instances from those 
   modules, and
3) are using apr_memcache to do so, and
4) would like to use the same apr_memcache_t handle for those connections, and
5) don't feel like writing and rewriting/cutting/pasting the Apache
   conf code to deal with it.

Note that 'mod_memcache' is a pretty vague and improper name for this
module, but thats what I'm calling it for now. That may change in
the future because a) its too close to mod_mem_cache, which is
completely different in purpose, and b) it doesn't reflect
specifically enough the purpose of this module. So yeah.

Note that this module is really only of interest to module developers
as it provides nothing more than a convenient way to deal with an



# install mod_memcache as a DSO into your Apache 2 directory

# if you grabbed the source from svn ...
% ./ 

# then 
% ./configure --with-apxs=/path/to/apxs \
% make
% make install



# in your httpd.conf ...

# load the shared object
LoadModule memcache_module modules/
# configure one or more memcached servers to use
MemcacheServer min=2 smax=4 max=5 ttl=60
MemcacheServer min=2 smax=4 max=5 ttl=60



/* in mod_yourmodule.c */

#include "mod_memcache.h"

/* .. in some handler .. */

apr_memcache_t *mc;
apr_status_t rv;

mc = ap_memcache_client(r->server);
rv = apr_memcache_set(mc, "cow", "moo", sizeof("cow") - 1, 0, 0);

/* ... etc., and/or ... */

apr_memcache_t *mc;
apr_status_t rv;
apr_hash_t *servers;
apr_hash_index_t *hi;

servers = ap_memcace_serverhash(r->server);
rv = apr_memcache_create(r->pool, 10, 0, &mc);
for (hi = apr_hash_first(pconf, servers); 
     hi = apr_hash_next(hi)) {
    apr_hash_this(hi, NULL, NULL, &val);
    ms = (apr_memcache_server_t *)val;

   rv = apr_memcache_add_server(mc, ms);