[Zope-dev] Calling rendered objects from a product

Dr. Ross Lazarus rossl@med.usyd.edu.au
Thu, 15 Jun 2000 18:21:50 +1000


More than one way to skin that particular cat I'll warrant.

here's one cut from a heavily used external method to render a zope
dynamic page to a disk file.

import Globals
...
	o = getattr(self,thingtorender)
        rendered_doc = o(client=o,REQUEST=REQUEST,globals=globals())
...

Incidentally, why bother making a cache inside of zope? There are
perfectly good ones already available out there like squid. Wouldn't it
be easier to just dump the result from every query you encounter into a
disk file. 

Serve with apache but run a squid cache front end to zope. This would be
relatively easy to develop and could probably run very fast.

Refresh the static files as often as needed. How often do things change
in the data? 

If slowly, hourly re-rendering of queries as they arrive might work ok.

Given that there are tools to do this, it just might be easier with
static html than with live zope.... 


Carlos Neves wrote
> 
>                  I need to call a rendered url, passed the REQUEST and wanted to do it directly
>                  to the self var. Not being able to do it, I have come with the solution of
>                  calling urllib with URL1, the called object and '?' + the query string... Not
>                   that fancy, but it works... slowly but smoothly.