Description
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | no |
RFC? | yes |
Symfony version | 4.1.0 |
Hi guys!
Awhile ago, I talked with Nicolas about adding a "simple-cache" service to the container (we would just wrap cache.app
with our PSR16 adapter and make cache.app.simple
. Then, we could add an alias so that Psr\SimpleCache\CacheInterface
can be used for autowiring.
Nicolas suggestion we should not do this, because we should push people towards the more powerful interface. But, I'm working with a user now, and I just saw two problems:
-
He tried to use
CacheInterface
, because it just guessed it - it's a good name. But, autowiring didn't work.AdapterInterface
andCacheItemPoolInterface
are much worse names for types. -
He found the PSR6 cache interface WAY confusing and complex: he simply wanted to store a few values with an expiration. But he was hit with this overkill.
So, I'd like to re-propose this: add the simple cache, and allow people to use it. If people need more complex features, then we show them the more powerful interface.