@@ -389,7 +389,8 @@ case the value needs to be recalculated.
389
389
cache :
390
390
pools :
391
391
my_cache_pool :
392
- adapter : app.my_cache_chain_adapter
392
+ adapter : cache.adapter.psr6
393
+ provider : app.my_cache_chain_adapter
393
394
cache.my_redis :
394
395
adapter : cache.adapter.redis
395
396
provider : ' redis://user:[email protected] '
@@ -418,17 +419,19 @@ case the value needs to be recalculated.
418
419
419
420
<framework : config >
420
421
<framework : cache >
421
- <framework : pool name =" my_cache_pool" adapter =" app.my_cache_chain_adapter" />
422
+ <framework : pool name =" my_cache_pool" adapter =" cache.adapter.psr6 " provider = " app.my_cache_chain_adapter" />
422
423
<framework : pool name =" cache.my_redis" adapter =" cache.adapter.redis" provider =" redis://user:[email protected] " />
424
+ <framework : pool name =" cache.apcu" adapter =" cache.adapter.apcu" />
425
+ <framework : pool name =" cache.array" adapter =" cache.adapter.array" />
423
426
</framework : cache >
424
427
</framework : config >
425
428
426
429
<services >
427
430
<service id =" app.my_cache_chain_adapter" class =" Symfony\Component\Cache\Adapter\ChainAdapter" >
428
431
<argument type =" collection" >
429
- <argument type =" service" value =" cache.adapter.array" />
432
+ <argument type =" service" value =" cache.array" />
433
+ <argument type =" service" value =" cache.apcu" />
430
434
<argument type =" service" value =" cache.my_redis" />
431
- <argument type =" service" value =" cache.adapter.file" />
432
435
</argument >
433
436
<argument >31536000</argument >
434
437
</service >
@@ -442,28 +445,37 @@ case the value needs to be recalculated.
442
445
'cache' => [
443
446
'pools' => [
444
447
'my_cache_pool' => [
445
- 'adapter' => 'app.my_cache_chain_adapter',
448
+ 'adapter' => 'cache.adapter.psr6',
449
+ 'provider' => 'app.my_cache_chain_adapter',
446
450
],
447
451
'cache.my_redis' => [
448
452
'adapter' => 'cache.adapter.redis',
449
453
'provider' => 'redis://user:[email protected] ',
450
454
],
455
+ 'cache.apcu' => [
456
+ 'adapter' => 'cache.adapter.apcu',
457
+ ],
458
+ 'cache.array' => [
459
+ 'adapter' => 'cache.adapter.array',
460
+ ],
451
461
],
452
462
],
453
463
]);
454
464
455
465
$container->getDefinition('app.my_cache_chain_adapter', \Symfony\Component\Cache\Adapter\ChainAdapter::class)
456
466
->addArgument([
457
- new Reference('cache.adapter.array'),
467
+ new Reference('cache.array'),
468
+ new Reference('cache.apcu'),
458
469
new Reference('cache.my_redis'),
459
- new Reference('cache.adapter.file'),
460
470
])
461
471
->addArgument(31536000);
462
472
463
473
.. note ::
464
474
465
- In this configuration there is a ``cache.my_redis `` pool that is used as an
466
- adapter in the ``app.my_cache_chain_adapter ``
475
+ In this configuration the ``my_cache_pool `` pool is using the ``cache.adapter.psr6 ``
476
+ adapter and the ``app.my_cache_chain_adapter `` service as a provider. That is
477
+ because ``ChainAdapter `` does not support the ``cache.pool `` tag. So it is decorated
478
+ with the ``ProxyAdapter ``.
467
479
468
480
469
481
Using Cache Tags
0 commit comments