caching python script in product skins?
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? Thanks in advance. Regards, ZhiMin
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. jens
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@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
participants (3)
-
Choo Zhi Min -
Jens Vagelpohl -
Tres Seaver