[Zope-CMF] CMF caching policy manager

Geoff Davis geoff@geoffdavis.net
Thu, 15 Aug 2002 17:04:12 -0400


> FSPageTemplates already do this by default.  Customized ones won't,
> which is one reason I have contemplated using a derived-from-ZPT class
> for skin methods;  the "stock" ZPTs can be cached, but they use a whole
> other mechanism.

Ok -- so let me make sure I understand correctly.  If I create filesystem
ZPT in a skin, the policies in the Cache Policy Manager will be applied?
But if I customize a skin through the web, the Policy Manager won't be
invoked?  Or am I completely off base here?

Suppose I have a class of ZPT's that are basically static, and another with
forms on them that I never want cached.  What's the easiest way to set a
flag that the Cache Policy Manager will see when testing its predicates?
Something in the ZPT?  Something external via the ZMI?

Thanks!

Geoff



Geoff Davis
http://www.geoffdavis.net


----- Original Message -----
From: "Tres Seaver" <tseaver@zope.com>
To: "Geoff Davis" <geoff@geoffdavis.net>
Cc: "Zope CMF" <zope-cmf@zope.org>; "Plone Developers"
<plone-developers@lists.sourceforge.net>
Sent: Thursday, August 15, 2002 4:48 PM
Subject: Re: [Zope-CMF] CMF caching policy manager


> On Thu, 2002-08-15 at 14:49, Geoff Davis wrote:
> > Hi all--
> >
> > The CMF Caching Policy Manager looks potentially quite cool, but I'm a
> > little unclear on the best way to use it.  It looks like one somehow
needs
> > to invoke something like
> >
> >
response.setHeaders(self.getattr('name_of_caching_policy_manager').getHTTPCa
> > chingHeaders(bunch of params here))
> >
> > in a page template.  That's kind of ugly, but if placed in a common
header
> > or macro somewhere, doesn't seem too bad.
> >
> > Has anybody actually used the Caching Policy Manager?  Any pointers on
good
> > practices?  Can anyone enlighten me as to all the params required to set
up
> > the TALES expressions?  (content, view_method, keywords, time)
>
> FSPageTemplates already do this by default.  Customized ones won't,
> which is one reason I have contemplated using a derived-from-ZPT class
> for skin methods;  the "stock" ZPTs can be cached, but they use a whole
> other mechanism.  Here is what FSPageTemplates do, BTW (inside
> pt_render)::
>
>     if REQUEST:
>
>         content = aq_parent( self )
>
>         mgr = getToolByName( content
>                             , 'caching_policy_manager'
>                             , None
>                             )
>
>         if mgr:
>             view_name = self.getId()
>             RESPONSE = REQUEST[ 'RESPONSE' ]
>             headers = mgr.getHTTPCachingHeaders( content
>                                                 , view_name
>                                                 , extra_context
>                                                 )
>             for key, value in headers:
>                 RESPONSE.setHeader( key, value )
>
> Tres.
> --
> ===============================================================
> Tres Seaver                                tseaver@zope.com
> Zope Corporation      "Zope Dealers"       http://www.zope.com
>
>