@@ -374,11 +374,21 @@ and use that when configuring the pool.
374
374
Creating a Cache Chain
375
375
----------------------
376
376
377
- Different cache adapters have different strengths and weaknesses. Some might be really
378
- quick but small and some may be able to contain a lot of data but are quite slow.
379
- To get the best of both worlds you may use a chain of adapters. The idea is to
380
- first look at the quick adapter and then move on to slower adapters. In the worst
381
- case the value needs to be recalculated.
377
+ Different cache adapters have different strengths and weaknesses. Some might be
378
+ really quick but optimized to store small items and some may be able to contain
379
+ a lot of data but are quite slow. To get the best of both worlds you may use a
380
+ chain of adapters.
381
+
382
+ A cache chain combines several cache pools into a single one. When storing an
383
+ item in a cache chain, Symfony stores it in all pools sequentially. When
384
+ retrieving an item, Symfony tries to get it from the first pool. If it's not
385
+ found, it tries the next pools until the item is found or an exception is thrown.
386
+ Because of this behavior, it's recommended to define the adapters in the chain
387
+ in order from the fastest to the slowest.
388
+
389
+ If an error happens when storing an item in a pool, Symfony stores it in the
390
+ other pools and no exception is thrown. Later, when the item is retrieved,
391
+ Symfony stores the item automatically in all the missing pools.
382
392
383
393
.. versionadded :: 4.4
384
394
@@ -478,7 +488,7 @@ the same key could be invalidate with one function call::
478
488
}
479
489
}
480
490
481
- The cache adapter needs to implement :class: `Symfony\\ Contracts\\ Cache\\ TagAwareCacheInterface` `
491
+ The cache adapter needs to implement :class: `Symfony\\ Contracts\\ Cache\\ TagAwareCacheInterface `
482
492
to enable this feature. This could be added by using the following configuration.
483
493
484
494
.. configuration-block ::
0 commit comments