X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FCore%2FContainer.php;h=1587f7263d0166feca2905c2a481b99debcbfe25;hb=96689db3d7b9276b10db3ee21b4cb9eed9ffc166;hp=533e8d8b945be5456d5fe454de6eb42af30192e8;hpb=fa4de9b377de72ab40004f1ed874d8d4d8dc34b7;p=civicrm-core.git diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php index 533e8d8b94..1587f7263d 100644 --- a/Civi/Core/Container.php +++ b/Civi/Core/Container.php @@ -157,16 +157,23 @@ class Container { 'session' => 'CiviCRM Session', 'long' => 'long', 'groups' => 'contact groups', + 'navigation' => 'navigation', ]; foreach ($basicCaches as $cacheSvc => $cacheGrp) { + $definitionParams = [ + 'name' => $cacheGrp, + 'type' => ['*memory*', 'SqlGroup', 'ArrayCache'], + ]; + // For Caches that we don't really care about the ttl for and/or maybe accessed + // fairly often we use the fastArrayDecorator which improves reads and writes, these + // caches should also not have concurrency risk. + $fastArrayCaches = ['groups']; + if (in_array($cacheSvc, $fastArrayCaches)) { + $definitionParams['withArray'] = 'fast'; + } $container->setDefinition("cache.{$cacheSvc}", new Definition( 'CRM_Utils_Cache_Interface', - [ - [ - 'name' => $cacheGrp, - 'type' => ['*memory*', 'SqlGroup', 'ArrayCache'], - ], - ] + [$definitionParams] ))->setFactory('CRM_Utils_Cache::create'); }