[Zope] Caching Catalog results for performance

Heimo Laukkanen huima at iki.fi
Wed Feb 25 17:12:26 EST 2004


On Tue, 24 Feb 2004 21:21:21 +0100, Dieter Maurer <dieter at handshake.de>  
wrote:

> I have implemented caching. I am using a dictionary (keyed by
> paths) of dictionaries (keyed by textual query representations; values
> are triples [searchTime, lastAccessTime, result])
> in a module namespace.
> "searchTime" is used to ignore outdated results, "lastAccessTime"
> is used to flush old cache entries.

Thanks for the tip. I haven't used module namespace before, though I read  
in ZODB docs about possibility to use either volatile attributes or module  
namespace. Are there - besides ZEO - any issues that I should be aware of  
before doing it? And is there actually anything else in it than creating a  
module with functions that get and set data, and flush cached data.

> Drawback: the cache cannot be (easily) controlled across
> ZEO clients.

One thing why I thought first about using cache objects instead of module  
namespace was the possibility to share cache between ZEO clients if  
temporary folder will be changed into persistent folder and mapped with  
dbtab according to the recipe found at zopelabs.

http://www.zopelabs.com/cookbook/1061234337

Naturally this would make it slower than using module namespace, but it  
shouldn't it still be faster than doing new queries to catalog.

Any thoughts on that.

-- 
-huima




More information about the Zope mailing list