I would like to set a default cache lifetime / timeout for doctrine caches in my different environments.
php bin/console config:dump-reference doctrine
shows only options to set the lifetime quite deep down in the advanced configuration in the entity manager regions, where I rather would not mess around. I cannot believe that there is no place to set a general value for db result caching.
Is there really no option to set the default timeout for the cache in a config file?
currrent config/test/doctrine.yaml:
doctrine:
orm:
auto_generate_proxy_classes: false
metadata_cache_driver:
type: service
id: doctrine.system_cache_provider
query_cache_driver:
type: service
id: doctrine.system_cache_provider
result_cache_driver:
type: service
id: doctrine.result_cache_provider
services:
doctrine.result_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.result_cache_pool'
doctrine.system_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.system_cache_pool'
framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system
In config/packages/prod/doctrine.yaml Need to change to: