[Zope-CMF] DirectoryView question

Andy McKay andy@agmweb.ca
Mon, 4 Nov 2002 23:43:01 -0800


For Plone I wanted to put standard FS* objects cacheable using a cache
manager. This I have done, should I just check in to HEAD or something else?

Longer question:

To perform this however I ended up in a bit of wierdness with PageTemplates,
the rest was straight forward. A DirectoryView creates a
DirectoryViewSurrogate object on each request and returns the object from
there. However PageTemplates use self._getContext() as key for the Cache.
_getContext() however varies for each call since it returns the new
DirectoryViewSurrogate object for each call.

The easiest way around this is to give DirectoryViewSurrogate the
_is_wrappable param so that _getContext gets context from the parent
DirectoryView object, a stable object.

However, it could be done a few other ways (make only one
DirectoryViewSurrogate object per DirectoryView or not use this value as a
key for the cache lookup). The only other place I could find _is_wrappable
is PermissionMapping.py.

Any ideas?
--
  Andy McKay
  www.agmweb.ca