[Zope] caching

Geir Bækholt Geir Bækholt <geirh@funcom.com>
Wed, 13 Nov 2002 08:45:20 +0100


on or about, Wednesday, November 13, 2002, we have reason to believe
that Jorg E. R=F8dsj=F8 wrote something along the lines of :

JER> I have a python function which returns a list of dictionaries (a resul=
t for
JER> an ldap query). But since I don't want to enrage the sysadmin or have a
JER> real slow page, I want to be able to cache this list in zope, and only
JER> update it every hour or so.=20

JER> The question then is : Could anyone suggest something to store this li=
st
JER> in=3F Preferably something which could accept the the list as it is, a=
nd be
JER> able to return it in a way so that I could iterate over it and build my
JER> webpage. I'm really not sure what would be the quickest/and or easiest.

the built-in RAM-Cache-managers will do exactly this for you.
Really quick , and really easy.
http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/ZopeServices.stx

Except.. It does not seem like RAM-Cache-managers can cache external
methods.. :P
you will have to set up a proxying script(python) just returning the
list. You can then associate the script with a RAM-cache with a 1 hour
timeout.




--=20
Geir B=E6kholt        geir@funcom.com
Tools/HCI-developer
Tools/Billing - Product Operations
Funcom Oslo