[Zope-PAS] PAS Caching

Chris McDonough chrism at plope.com
Mon Nov 8 03:56:08 EST 2004

On Mon, 2004-11-08 at 09:24 +0100, Jens Vagelpohl wrote:
> One of the reasons I did not want to touch RAMCacheManager itself is 
> simply the fact that I didn't want to tell the customer to run some CVS 
> checkout of Zope in order to make this work. Your argument is perfectly 
> valid otherwise. What I'll do is indeed change RAMCacheManager and 
> apply the "enhancements" there. If the customer does not want to use a 
> CVS checkout I'll build a monkeypatch product.

Maybe just create a BetterRAMCacheManager product?

> > Also, caching the user object proper in _findUser is probably an
> > accident waiting to happen.  The PAS API doesn't specify that the user
> > object can't be persistent (it's not in the default implementation, but
> > a plugin can do whatever it wants), and caching a persistent object in 
> > a
> > module-level global is bad news.  If we put this code in there, we need
> > to make it clear that the contract of createUser in IUserFactory is
> > required to return non-acquisition-wrapped, non-persistent objects.
> The code already does a aq_base on the user before storing it, so 
> that's not a problem. As far as the persistent user goes, IMHO that's a 
> bridge I will cross when we get to it.

Maybe it'd be good to put a "if getattr(user, '_p_jar', None) is not
None: raise RuntimeError" before doing the ZCacheable_set so people
don't waste too much time if they make a mistake and feed it a
persistent object?

- C

More information about the Zope-PAS mailing list