mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
caching.md, false examples: updated
The previous exmaple for adding a Mamcached backend was not working properly. Using this example results in Zend_Cache_Backend_Memcached using the default (fallback) settings (which are exactly the same as in the exmaple though). + Added an extra example for Memcached instances which are listening on a Unix socket.
This commit is contained in:
parent
8ce6d89e78
commit
6fd737d252
@ -131,6 +131,28 @@ To use this backend, you need a memcached daemon and the memcache PECL extension
|
||||
);
|
||||
SS_Cache::pick_backend('primary_memcached', 'any', 10);
|
||||
|
||||
If your Memcached instance is using a local Unix socket instead of a network port:
|
||||
|
||||
:::php
|
||||
// _config.php
|
||||
SS_Cache::add_backend(
|
||||
'primary_memcached',
|
||||
'Memcached',
|
||||
array(
|
||||
'servers' => array(
|
||||
'host' => 'unix:///path/to/memcached.socket',
|
||||
'port' => 0,
|
||||
'persistent' => true,
|
||||
'weight' => 1,
|
||||
'timeout' => 5,
|
||||
'retry_interval' => 15,
|
||||
'status' => true,
|
||||
'failure_callback' => null
|
||||
)
|
||||
)
|
||||
);
|
||||
SS_Cache::pick_backend('primary_memcached', 'any', 10);
|
||||
|
||||
### APC
|
||||
|
||||
This backends stores cache records in shared memory through the [APC](http://pecl.php.net/package/APC)
|
||||
|
Loading…
Reference in New Issue
Block a user