diff --git a/docs/en/reference/caching.rst b/docs/en/reference/caching.rst index d45090cbc..86cdef999 100644 --- a/docs/en/reference/caching.rst +++ b/docs/en/reference/caching.rst @@ -65,7 +65,7 @@ Memcache In order to use the Memcache cache driver you must have it compiled and enabled in your php.ini. You can read about Memcache -` on the PHP website `_. It will +` on the PHP website `_. It will give you a little background information about what it is and how you can use it as well as how to install it. @@ -82,6 +82,31 @@ driver by itself. $cacheDriver->setMemcache($memcache); $cacheDriver->save('cache_id', 'my_data'); +Memcached +~~~~~~~~ + +Memcached is a more recent and complete alternative extension to +Memcache. + +In order to use the Memcached cache driver you must have it compiled +and enabled in your php.ini. You can read about Memcached +` on the PHP website `_. It will +give you a little background information about what it is and how +you can use it as well as how to install it. + +Below is a simple example of how you could use the Memcached cache +driver by itself. + +.. code-block:: php + + addServer('memcache_host', 11211); + + $cacheDriver = new \Doctrine\Common\Cache\MemcachedCache(); + $cacheDriver->setMemcached($memcached); + $cacheDriver->save('cache_id', 'my_data'); + Xcache ~~~~~~