3

Config.yml:

cache:
    app: cache.adapter.doctrine
    system: cache.adapter.doctrine
    default_doctrine_provider: ~
    default_psr6_provider: ~
    default_redis_provider: "redis://localhost:6379"

Symfony 3.1 support doctrine cache, but you do not have enough documentation.

Cache Component: http://symfony.com/doc/current/components/cache.html
Supported drives: http://symfony.com/doc/current/components/cache/cache_pools.html
Symfony Integration: http://symfony.com/blog/new-in-symfony-3-1-cache-component

default_doctrine_provider: ? What do I enter as Provider

Cesur APAYDIN
  • 806
  • 3
  • 11
  • 24

2 Answers2

2

You can pass to default_doctrine_provider either a Redis connection DSN (for example "redis://127.0.0.1:6379") or ID of a service which implements Symfony\Component\Cache\Adapter\AdapterInterface

You can have a look at already implemented adapters here

nikita2206
  • 1,129
  • 2
  • 10
  • 17
0

The provider basically is the original doctrine_cache provider you configured. Let's say you use the DoctrineCacheBundle and your provider name is my_apc_cache that means the container has the following service:

$myCache = $this->container->get('doctrine_cache.providers.my_apc_cache');

You could also define an alias, then it is even easier.

Take a look at the example at: https://symfony.com/doc/current/bundles/DoctrineCacheBundle/usage.html#service-aliases

Rvanlaak
  • 2,971
  • 20
  • 40