From 6fd737d2525041352cee2551dc97a80c118d0e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabrijel=20Gavranovic=CC=81?= Date: Mon, 29 Sep 2014 00:02:20 +0200 Subject: [PATCH] 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. --- .../08_Performance/01_Caching.md | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/en/02_Developer_Guides/08_Performance/01_Caching.md b/docs/en/02_Developer_Guides/08_Performance/01_Caching.md index 7e9d236d3..ca76d60da 100644 --- a/docs/en/02_Developer_Guides/08_Performance/01_Caching.md +++ b/docs/en/02_Developer_Guides/08_Performance/01_Caching.md @@ -114,7 +114,7 @@ To use this backend, you need a memcached daemon and the memcache PECL extension :::php // _config.php SS_Cache::add_backend( - 'primary_memcached', + 'primary_memcached', 'Memcached', array( 'servers' => array( @@ -130,6 +130,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