[Zope] Re: caching python script in product skins?
Tres Seaver
tseaver at zope.com
Wed Oct 13 09:21:18 EDT 2004
Jens Vagelpohl wrote:
>
> On Oct 13, 2004, at 9:40, Choo Zhi Min wrote:
>
>> Hi,
>>
>> I have some python scipts in the skins directory of my custom zope
>> product. They only have Customize and Test tabs, but no Cache tab. How
>> to cache them like other python scripts that exist in ZMI?
>
>
> You cannot directly cache the file system scripts using the ZCacheable
> mechanism, unless you "customize" them so they become "real" Python
> scripts. The FSPythonScript class does not mix in the ZCacheable mixin
> class that provides cacheability, only the standard PythonScript class
> does.
Actually, all FSObject-derived skin methods are cacheable as of CMF 1.4;
because they are filesystem-based, you must indicate the cache to be
used on the filesystem, by adding an entry to the corresponding
.properties file. E.g., to make the 'foo_view' template in your product
cacheable, add the following line to 'foo_view.pt.properties':
cache=my_cache
and then ensure that you have a RAMCacheManager named 'my_cache'
acquirable by the skin method.
Tres.
--
===============================================================
Tres Seaver tseaver at zope.com
Zope Corporation "Zope Dealers" http://www.zope.com
More information about the Zope
mailing list