[Zope-CMF] CachingPolicyManager

Jens Vagelpohl jens at dataflake.org
Wed Oct 11 12:03:29 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> 1. Add two filesystem zpts:
>
> output_page_1:
> ==============
> <html>
> <head>
>  <title>test page</title>
> </head>
>
> <h1>Here is the title</h1>
>
> <x tal:replace="structure here/output_page_2" />
>
> </html>
>
>
> output_page_2:
> ==============
> <h2>Here is the subtitle from template 2</h2>
>
> 2.  Add a rule to the cpm as follows:
>
> id: "template_test"
> predicate: view.endswith('_2')
> etag: string:"template_test"
>
> 3.  Make a request for <yoursite>/output_page_1
>
> 4.  Note that the caching rule for output_page_2 is applied
>
> This is because the cpm is called whenever a FSZPT is called - so  
> the call to the second template causes it to check it's rules again.
>
> My question is, does this count as a bug?

I'm not sure this can be called a bug. It is true (and perfectly  
normal) that rendering a filesystem page template will always call  
the CPM. You're rendering both here. Since output_page_2 is rendered  
last as it's calles from output_page_1 the rule for output_page_2  
fires and will overwrite existing headers/add new headers according  
to the rule that fires. The problem here is that both happen in the  
same request, the rendering code does not distinguish betwen the  
primary and the nested rendering.

jens


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFLRXRRAx5nvEhZLIRAotWAKCXhqMMsbWiBDGmiyzkAh82WfmPKACfQTg0
x7Bvb1S/eObv48e3Rdc7LYw=
=Deln
-----END PGP SIGNATURE-----


More information about the Zope-CMF mailing list