1
0
mirror of synced 2025-03-03 11:23:21 +03:00

Merge pull request #1290 from phansys/doc-slc

[Doc] [Reference] [Second Level Cache]
This commit is contained in:
Marco Pivetta 2015-01-27 16:37:22 +00:00
commit ffaffa0b8a

View File

@ -174,8 +174,8 @@ Configuration
Doctrine allows you to specify configurations and some points of extension for the second-level-cache Doctrine allows you to specify configurations and some points of extension for the second-level-cache
Enable Second Level Cache Enabled Enable Second Level Cache
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
To enable the second-level-cache, you should provide a cache factory To enable the second-level-cache, you should provide a cache factory
``\Doctrine\ORM\Cache\DefaultCacheFactory`` is the default implementation. ``\Doctrine\ORM\Cache\DefaultCacheFactory`` is the default implementation.
@ -261,10 +261,10 @@ By providing a cache logger you should be able to get information about all cach
// Get the total number of put in all regions. // Get the total number of put in all regions.
$logger->getPutCount(); $logger->getPutCount();
// Get the total number of entries successfully retrieved from all regions. // Get the total number of entries successfully retrieved from all regions.
$logger->getHitCount(); $logger->getHitCount();
// Get the total number of cached entries *not* found in all regions. // Get the total number of cached entries *not* found in all regions.
$logger->getMissCount(); $logger->getMissCount();
If you want to get more information you should implement ``\Doctrine\ORM\Cache\Logging\CacheLogger``. If you want to get more information you should implement ``\Doctrine\ORM\Cache\Logging\CacheLogger``.
@ -698,11 +698,11 @@ For performance reasons the cache API does not extract from composite primary ke
} }
// Supported // Supported
/** @var $article Article */ /* @var $article Article */
$article = $em->find('Article', 1); $article = $em->find('Article', 1);
// Supported // Supported
/** @var $article Article */ /* @var $article Article */
$article = $em->find('Article', $article); $article = $em->find('Article', $article);
// Supported // Supported
@ -713,10 +713,10 @@ For performance reasons the cache API does not extract from composite primary ke
$id = array('source' => new Article(1), 'target' => new Article(2)); $id = array('source' => new Article(1), 'target' => new Article(2));
$reference = $em->find('Reference', $id); $reference = $em->find('Reference', $id);
Distribute environments Distributed environments
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
Some cache driver are not meant to be used in a distribute environment Some cache driver are not meant to be used in a distributed environment.
Load-balancer for distributing workloads across multiple computing resources Load-balancer for distributing workloads across multiple computing resources
should be used in conjunction with distributed caching system such as memcached, redis, riak ... should be used in conjunction with distributed caching system such as memcached, redis, riak ...