[Zope-dev] RAMcache and container vs. context

Stefan H. Holek stefan at epy.co.at
Thu Apr 21 18:27:18 EDT 2005


This is due to how Python Scripts compute their cache keys. The 
relevant snippet from PythonScript._exec() is:

             asgns = self.getBindingAssignments()
             name_context = asgns.getAssignedName('name_context', None)
             if name_context:
                 keyset[name_context] = aq_parent(self).getPhysicalPath()

Note that aq_parent() gives you the URL parent, not the container. I 
see no way around that as the return value of a script may well depend 
on its context.

HTH,
Stefan


On 21. Apr 2005, at 22:26, Paul Winkler wrote:

> It's not obvious to me from the code why this is happening
> (or why it might be desirable).  The cache manager stores and looks
> up items by their getPhysicalPath(), so I don't see why context vs.
> container is relevant.  If I'd wanted the URL to be relevant,
> I would have put that in the REQUEST Variables configuration.
>

--
Software Engineering is Programming when you can't. --E. W. Dijkstra



More information about the Zope-Dev mailing list