v5:userguide:learn_caching:memcached
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
v5:userguide:learn_caching:memcached [2016/03/29 01:14] – mnewnham | v5:userguide:learn_caching:memcached [2017/04/15 18:28] – mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
<- v5: | <- v5: | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
Line 6: | Line 5: | ||
[[https:// | [[https:// | ||
[[https:// | [[https:// | ||
- | == Note == | + | [[https:// |
- | Do not use the newer PEAR memcached library | + | |
</ | </ | ||
====== Memcached Setup ====== | ====== Memcached Setup ====== | ||
- | Memcached provides a controlled, server based memory caching service. The server is reasonably easily configured and installed, but provides a sophisticated caching configuration. PHP support for the library is available through the PHP PEAR memcache library. | + | Memcached provides a controlled, server based memory caching service. The server is reasonably easily configured and installed, but provides a sophisticated caching configuration. PHP support for the library is available through the PHP PEAR memcache or PEAR memcached libraries. If both the memcache and memcached libraries are available, the memcache library |
+ | |||
+ | Your platform and PHP version will be the primary decision factors between using memcache or memcached. In general, the following guidelines can be used. | ||
+ | |||
+ | ^ Platform | ||
+ | | Windows | ||
+ | | Unix | 5.x | memcache | ||
+ | | Unix | 7.x | memcached | | ||
+ | |||
+ | It's also worth noting that compression is not supported with memcached. If you need cache compression, | ||
For larger environments, | For larger environments, | ||
Line 18: | Line 25: | ||
$db = NewADOConnection($driver=' | $db = NewADOConnection($driver=' | ||
+ | |||
/* | /* | ||
- | * Enable memcache | + | * Enable memcache |
- | */ | + | */ |
$db-> | $db-> | ||
+ | |||
/* | /* | ||
- | * Add one or more servers, for use in distributed systems | + | * Add one or more servers, for use in distributed systems |
- | */ | + | */ |
$db-> | $db-> | ||
+ | |||
/* | /* | ||
- | * Optionally add the server port if it differs from the default | + | * Optionally add the server port if it differs from the default |
- | */ | + | */ |
$db-> | $db-> | ||
+ | |||
/* | /* | ||
- | * Use ' | + | * Use ' |
- | */ | + | * Note; Compression is only supported using the memcache library. This |
- | $db-> | + | |
+ | */ | ||
+ | $db-> | ||
/* | /* | ||
- | * We connect to the database, not the memcache server | + | * We connect to the database, not the memcache server |
- | */ | + | */ |
$db-> | $db-> | ||
- | |||
</ | </ | ||
+ |
v5/userguide/learn_caching/memcached.txt · Last modified: 2018/07/16 20:18 by peterdd