Quantcast
Channel: How to tell doctrine to ignore Memcached if server is offline? - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by sadok-f for How to tell doctrine to ignore Memcached if server is offline?

$
0
0

You can use The Second Level Cache available in doctrine/orm 2.5

see: http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/second-level-cache.html

The idea to keep you default options for orm and add a memcache as second level cache:

  orm:
     entity_managers:
        default:
           auto_mapping:  true
           second_level_cache:
               region_cache_driver:
                  type:                 service
                  id:                   doctrine.cache.memcache2
               enabled:              true
               regions:
                  region_name:
                       cache_driver:
                           type:                 service
                           id:                   doctrine.cache.memcache2

When turned on, entities will be first searched in cache and if they are not found, a database query will be fired and then the entity result will be stored in a cache provider.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images