orm icon indicating copy to clipboard operation
orm copied to clipboard

How to configure the TTL for the cache driver

Open bicatu opened this issue 5 years ago • 1 comments

I am trying to configure APC as cache driver for metadata and query cache. On the provided doctrine.php config it is clear to do so using the equivalent ENV vars.

One thing that I did not find is how to pass the ttl parameter so I can control the expected time to live on those.

Using version 1.4

bicatu avatar Feb 07 '20 16:02 bicatu

I don't think you can set TTL for metadata? This is handled by doctrine. See: https://github.com/doctrine/persistence/blob/master/lib/Doctrine/Persistence/Mapping/AbstractClassMetadataFactory.php#L193

TTL on query is per-query. You must set this on the QueryBuilder/Query object AFAIK.

BTW: It is preferable to use php_file for metadata-cache (adding it now (#433)). See: https://github.com/doctrine/orm/blob/2.7/docs/en/reference/caching.rst#phpfilecache

eigan avatar Feb 16 '20 15:02 eigan