Commit 6ca86b7f authored by Yoshinori Okuji's avatar Yoshinori Okuji

Optimize the cache retrieval when a quick cache is available.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29676 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7c588c78
......@@ -68,6 +68,7 @@ class CacheFactory:
## separete local and shared cache plugins
self.quick_cache = self.cache_plugins[0]
self._quick_cache_get = self.quick_cache.get
try:
self.shared_caches = self.cache_plugins[1:]
except IndexError:
......@@ -92,8 +93,7 @@ class CacheFactory:
self.expire(now)
try:
quick_cached = self.quick_cache.get(cache_id, scope)
return quick_cached.getValue()
return self._quick_cache_get(cache_id, scope).getValue()
except KeyError:
## not in local, check if it's in shared
for shared_cache in self.shared_caches:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment