-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Description
| Q | A |
|---|---|
| Bug report? | no |
| Feature request? | yes |
| BC Break report? | no |
| RFC? | yes |
| Symfony version | 4.1 |
There are 2 usability problems with the cache that I think it's important to solve:
-
Though there is a
TagAwareAdapterclass, to use cache tagging, you need to setup your own service via decoration ([FrameworkBundle] Is TagAwareAdapter declared as a service? #20764). That's too much complex work and makes cache tagging out-of-reach for most users. -
The interface names for autowiring are quite bad:
CacheItemPoolInterfaceorAdapterInterface. ATaggableCacheInterfacewould be much better ... and it would extendTagAwareAdapterInterface. It's a bit silly... as this would exist just for better autowiring, but it is important. In 4.1, this would give us autowiring withCacheInterface(for simple PSR-16 style) orTaggableCacheInterface(in addition to the 2 uglier [sorry] interface names I listed first).
Question: Is there a downside to always using TagAwareAdapter? My guess is that there's some performance impact. If so, we could "opt-in" to wrapping cache.app in TagAwareAdapter with config. Or have a separate, wrapped service always exist, but only autowire when the TaggableCacheInterface is used.