Enable keystone caching

Enable keystone caching since there is now a memcache server available
for the middlewares to cache validation. Offload queries to the
keystone backend to memcache as well.

Change-Id: I6d1d28f5b974e79d44d1e86ea53c666e3f5771df
diff --git a/lib/keystone b/lib/keystone
index 7592804..d60a4ba 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -218,6 +218,14 @@
     iniset $KEYSTONE_CONF role driver "$KEYSTONE_ROLE_BACKEND"
     iniset $KEYSTONE_CONF resource driver "$KEYSTONE_RESOURCE_BACKEND"
 
+    # Enable caching
+    iniset $KEYSTONE_CONF cache enabled "True"
+    iniset $KEYSTONE_CONF cache backend "oslo_cache.memcache_pool"
+    iniset $KEYSTONE_CONF cache memcache_servers $SERVICE_HOST:11211
+
+    # Do not cache the catalog backend due to https://bugs.launchpad.net/keystone/+bug/1537617
+    iniset $KEYSTONE_CONF catalog caching "False"
+
     iniset_rpc_backend keystone $KEYSTONE_CONF
 
     # Register SSL certificates if provided