laminas / laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output
https://docs.laminas.dev/laminas-cache/
BSD 3-Clause "New" or "Revised" License
98 stars 51 forks source link

Add `cache` configuration key documentation #265

Open boesing opened 1 year ago

boesing commented 1 year ago

Feature Request

Q A
Documentation yes

Summary

There is a cache config key which can be used for some kind of "default" cache adapter for a project. https://github.com/laminas/laminas-cache/blob/fcc91acc630f372d3b3d7e43378233d9a143e3bd/src/Service/StorageCacheFactory.php#L19

Not yet a clue where this is used for, might be an MVC specific thing 🤷🏼‍♂️

froschdesign commented 1 year ago

@boesing I find it difficult to explain to the user that they can use caches and also cache. Because already the first one leads to the desired result and also only works with a single cache. So the question is: Is this factory really needed?

boesing commented 7 months ago

So the question is: Is this factory really needed?

@froschdesign I am not sure, could be dropped in v4 and we can see how this adds up. I'd also recommend to use some kind of StorageInterface::class => 'entry-in-caches-array', aliases entry instead if someone needs a default cache adapter as that would avoid having a redundant cache configuration laying around somewhere.

froschdesign commented 7 months ago

Any simplification or removal of confusion is welcome and absolutely necessary. I also think that the improvements implemented here must then be transferred to other components.