According to Doctrine’s documentation, you should always utilize a Query Cache.
You should always use query cache in a production environment. That said, you can easily use it during development, too. Whenever you change a DQL query and execute it the first time Doctrine sees that it has been modified and will therefore create a new cache entry, so you don’t even need to invalidate the cache.
That said, you need to add the following configuration options in
application.iniIf you have a standard Memcached running locally on port 11211 then the following should work.
resources.doctrine.manager.attributes.attr_query_cache.driver = memcache resources.doctrine.manager.attributes.attr_query_cache.options.servers.host = localhost resources.doctrine.manager.attributes.attr_query_cache.options.servers.port = 11211 resources.doctrine.manager.attributes.attr_query_cache.options.servers.persistent = true resources.doctrine.manager.attributes.attr_query_cache.options.compression = false
Did this help you out? It took me a few days to piece together all this information together, I hope this saves you some time (who knows, maybe the future me will be thankful I wrote this down). Let me know your thoughts. email@example.com