[Zope-CMF] CachingPolicyManager

Miles Waller miles at jamkit.com
Wed Oct 11 11:34:19 EDT 2006


Hi,

I'm trying to investigate a problem where the CPM is adding cache 
headers to a response for the wrong object.  I can reproduce it in plain
CMF as follows:


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 know that this example can be made to work by reformulating so that 
output_page_1 is a macro and requesting output_page_2, but if that's the 
answer then I think it should definitely be clearer in the docs.


Miles



More information about the Zope-CMF mailing list