8000 Add a Simple CacheInterface autowireable service · Issue #25708 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content 8000
Add a Simple CacheInterface autowireable service #25708
Closed
@weaverryan

Description

@weaverryan
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:

  1. He tried to use CacheInterface, because it just guessed it - it's a good name. But, autowiring didn't work. AdapterInterface and CacheItemPoolInterface are much worse names for types.

  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0