Autowire symfony CacheInterface depending on environment
问题 I am trying to use different cache system on my environments. I would like to have, for example, Filesystem for dev and memcached for prod . I am using symfony 3.3.10 . To achieve this, I would like to autowire the CacheInterface as follow: use Psr\SimpleCache\CacheInterface; class Api { public function __construct(CacheInterface $cache) { $this->cache = $cache; } } Here are my configuration files: config_dev.yml : framework: cache: app: cache.adapter.filesystem config_prod.yml : framework: