hi

i would like to cache the results of method in a view, and thougt, that RAMCache
could be of use here.

After spending a lot of time searching for some documentation or examples, i
came to this:

from zope.app.cache.ram import RAMCache
cache = RAMCache()
query = cache.query('test',key={'x':1})
if query == None:
        result = expensive_stuff_method()
        cache.set(result, 'test', key={'x':1})
        return result
else:
        return query

but that won´t work, the cache looses it´s entry, if i call the browser-view 
again.

any hints?
thanks, Dominique

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to