[Zope-CMF] CachingPolicy
Jens Vagelpohl
jens at dataflake.org
Thu Jun 22 13:19:57 EDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 22 Jun 2006, at 15:08, LESUEUR Frédéric wrote:
> hello,
> i have a question about the "_setCacheHeaders" methods inside this
> file CMFCore/utils.py.
>
> Why content is set to aq_parent and not the object itself ?
> The test of a policy is make with parent of object not this object. If
> i have a FSImage, the test is make with this context parent and no
> http cache is set.
>
> In my opinion content must be set to context obj, like that:
> content=obj
Please look at how it is being invoked inside e.g. CMFCore/FSFile.py
or CMFCore/FSImage.py. What gets passed into _setCacheHeaders is
*not* the Image or File, but a so-called view emulator. Its parent is
indeed the Image or File itself, so the function works correctly.
jens
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFEmtE9RAx5nvEhZLIRAqHEAJ9gTAVjqpduu8RN2pCdJCMqIjGRKgCfaZs1
lIBg6YEX7iOKe4B1mRBPtY4=
=+19p
-----END PGP SIGNATURE-----
More information about the Zope-CMF
mailing list