[Zope] How to store in a RAM cache a list of objects?

Dieter Maurer dieter at handshake.de
Mon Sep 26 14:26:50 EDT 2005


Ausum Studio wrote at 2005-9-26 03:19 -0500:
>I'd like to RAM cache the result of a long-runing ZopeFind method, formatted
>to a plain list of objects. But the RAM cache doesn't store the list and
>hence every time the supossedly cached method is called, the  ZopeFind
>process id triggered. Other data (like the lenght of the resulting list) is
>stored and retrieved with no problem, telling by the cache manager's stats
>tab.
>
>Is that normal behaviour of the RAM cache machinery?

It is very dangerous (and almost impossible) to cache persistent objects
outside of their ZODB connection.

The RAM Cache Manager knows about this danger and tries to make
sure, it caches only simple objects (not sure that it catches
persistent objects).

For this reason, you cannot cache the full result of a "ZopeFind".
However, you can cache the paths part of it.

-- 
Dieter


More information about the Zope mailing list