[Zope-CMF] Re: Caching Policy Manager

Fred Yankowski fred at ontosys.com
Mon Apr 26 12:08:00 EDT 2004

On Mon, Apr 26, 2004 at 10:02:53AM -0400, Jean-Francois.Doyon at CCRS.NRCan.gc.ca wrote:
> python: content.meta_type == 'Filesystem Image'
> python: content.getId() == 'something'
> etc ...
> But not matter what, I don't see any headers getting set as I'd
> expect.

Deja vu (this subject has arisen several times on the Zope lists and
always ends up in an inconclusive muddle).

Anyway, based on my testing and reading of the code, the 'content'
item available to the predicate in a policy is set to the *parent* of
the object being considered for cache headers.  Near as I can tell,
that makes it impossible to have tests like yours that check the
meta_type of the object itself.  See the _setCacheHeaders() function
in CMFCore/utils.py, where it sets content to the value of

Fred Yankowski      fred at ontosys.com           tel: +1.630.879.1312
OntoSys, Inc	    PGP keyID: 7B449345        fax: +1.630.879.1370
www.ontosys.com     38W242 Deerpath Rd, Batavia, IL 60510-9461, USA

More information about the Zope-CMF mailing list