I have a Zope utility and a method that executes network processes. Since the result has been valid for a while, I use plone.memoize.ram to cache the result.
MyClass(object): @cache(cache_key) def do_auth(self, adapter, data):
... and cache function:
def cache_key(method, utility, data): return time() // 60 * 60))
But I want memoization to be executed when the do_auth call returns empty results (or causes network errors).
Looking at the plone.memoize code, it seems to me that I need a raise ram.DontCache() exception, but before that I need to examine the original cached value.
How to get cached data from cache storage?
source share