[ZODB-Dev] ZEO Client Caching - Across multiple script runs?
Jim Fulton
jim at zope.com
Mon Mar 31 06:34:40 EDT 2008
On Mar 30, 2008, at 4:43 PM, Kenneth Miller wrote:
> All,
>
> Is it possible to have a zeo client save and access a cache from
> script run to run? I'm writing a cgi-script that uses a zeo client
> connection to gather data and produce and image, and the overhead is
> quite alot. Seeing as with CGI, the script is initializing python,
> loading the modules, initializing the connection and retrieving the
> data each time.
Yes. You can use a persistent cache. See the client option in the
ClientStorage constructor and in zConfig.
This might not be a good choice for a CGI script though. In the
current implementation, there is no locking of the cache file and it
is likely to be corrupted if 2 or more processes open it at the same
time.
Jim
--
Jim Fulton
Zope Corporation
More information about the ZODB-Dev
mailing list