I've and Zope utility with a method that perform network processes.
As the result of the is valid for a while, I'm using plone.memoize.ram
to cache the result.
MyClass(object):
@cache(cache_key)
def do_auth(self, adapter, data):
# performing expensive network process here
...and the cache function:
def cache_key(method, utility, data):
return time() // 60 * 60))
But I want to prevent the memoization to take place when the do_auth
call returns empty results (or raise network errors).
Looking at the plone.memoize code it seems I need to raise ram.DontCache()
exception, but before doing this I need a way to investigate the old cached value.
How can I get the cached data from the cache storage?