[Zope-dev] Declaring Dependencies for XML documents (Was: HowTo Improve Cache Coherency for RAM/Disk Cache Manager...?)

Shane Hathaway shane@zope.com
Tue, 04 Mar 2003 14:32:31 -0500


Andy McKay wrote:
>> Anyway, after talking this over with my colleague, I realize that
>> the problem of *deriving* dependencies is fundamentally undecidable.
>> We might be able to figure it out in the case of simple acquisition,
>> like
>> <span tal:replace="here/aObject/aMethod"/>
>> But it is hopeless for pure python:
>>
>> <span 
>> tal:replace="python:I-can-do-anything-and-you-cant-stop-me(REQUEST)"/>
>> :)
> 
> 
> Well you could, in theory, hook every object as CallProfiler does and 
> then you would know for each request what object was called and Cache 
> it. You could even do something really clever like using CallProfiler 
> automatically cache objects that took longer than a certain amount of 
> time...
> 
> But there are more issues with that than there are days in a year and 
> you could be writing that code forever, letting the user figure it out 
> manually is an easier choice.

Ah, but you might have something there.  What if there were a cache 
manager that simply dropped its contents whenever anything changes in 
ZODB?  You could associate nearly all scripts and templates with that 
cache manager without any fear of stale cache entries.  For many sites, 
it could be an instant win.

Shane