[Zope-CMF] How to cache CMF filesystem images?
Ausum Studio
ausum_studio@hotmail.com
Mon, 24 Mar 2003 17:32:27 -0500
----- Original Message -----
From: "Dieter Maurer" <dieter@handshake.de>
(...)
>
> Read the "Cache Manager API" (--> embedded online help),
> look at the management interface.
Thanks, but I'm having problems with the Caching Policy Manager.
I'm using the following script and caching policy to attempt to cache
filesystem images.
## Script (Python) "isFSImage"
if context.meta_type == "Filesystem Image":
return 1
else:
return 0
Caching Policy: (as entered in fields)
Policy ID: AnyID
Predicate: content/isFSImage No-cache?: unchecked
Mod. Time: content/modified No-store?: unchecked
Max age (secs): 999999 Must-revalidate?: unchecked
Now, "Folder contents" seem to work fine except that it still takes its time
to reload the icons at every page view. (Icons at ZMI doesn't present this
problem so I believe it's not a browser issue), while attempting to view
"newsitem_view" throws the traceback below.
What am I missing?
Ausum
traceback:
"""
Site Error
An error was encountered while publishing this resource.
KeyError
Sorry, a site error occurred.
Traceback (innermost last):
File D:\ARCHIV~1\Zope251\lib\python\ZPublisher\Publish.py, line 150, in
publish_module
File D:\ARCHIV~1\Zope251\lib\python\ZPublisher\Publish.py, line 114, in
publish
File D:\ARCHIV~1\Zope251\lib\python\Zope\__init__.py, line 159, in
zpublisher_exception_hook
(Object: testnews)
File D:\ARCHIV~1\Zope251\lib\python\ZPublisher\Publish.py, line 98, in
publish
File D:\ARCHIV~1\Zope251\lib\python\ZPublisher\mapply.py, line 88, in
mapply
(Object: view)
File D:\ARCHIV~1\Zope251\lib\python\ZPublisher\Publish.py, line 39, in
call_object
(Object: view)
File H:\Zope251Instance\Products\CMFCore\PortalContent.py, line 126, in
view
(Object: testnews)
File H:\Zope251Instance\Products\CMFCore\PortalContent.py, line 117, in
__call__
(Object: testnews)
File D:\ARCHIV~1\Zope251\lib\python\Shared\DC\Scripts\Bindings.py, line
252, in __call__
(Object: newsitem_view)
File D:\ARCHIV~1\Zope251\lib\python\Shared\DC\Scripts\Bindings.py, line
283, in _bindAndExec
(Object: newsitem_view)
File H:\Zope251Instance\Products\CMFCore\FSPageTemplate.py, line 167, in
_exec
(Object: newsitem_view)
File
D:\ARCHIV~1\Zope251\lib\python\Products\PageTemplates\ZopePageTemplate.py,
line 210, in _exec
(Object: newsitem_view)
File H:\Zope251Instance\Products\CMFCore\FSPageTemplate.py, line 133, in
pt_render
(Object: newsitem_view)
File H:\Zope251Instance\Products\CMFCore\CachingPolicyManager.py, line
463, in getHTTPCachingHeaders
(Object: caching_policy_manager)
File H:\Zope251Instance\Products\CMFCore\CachingPolicyManager.py, line
184, in getHeaders
File H:\Zope251Instance\Products\CMFCore\Expression.py, line 44, in
__call__
File D:\ARCHIV~1\Zope251\lib\python\Products\PageTemplates\Expressions.py,
line 198, in __call__
File D:\ARCHIV~1\Zope251\lib\python\Products\PageTemplates\Expressions.py,
line 193, in _eval
File D:\ARCHIV~1\Zope251\lib\python\Products\PageTemplates\Expressions.py,
line 93, in render
(Object: isImage)
File
D:\ARCHIV~1\Zope251\lib\python\Products\PageTemplates\ZRPythonExpr.py, line
67, in call_with_ns
(Object: __render_with_namespace__)
KeyError: here
"""