On Wed, 21 Feb 2007 13:03:30 +0100, Manlio Perillo <[EMAIL PROTECTED]> wrote:
[...]
class Resource(rend.rend):
template = ... # The child template to load
def render_main(self, ctx, data):
return self.state.setdefault(
template, loaders.xmlfile(self.template)
)
Here I'm storing the loader instance in a dictionary, to optimize template
loading.
Useless, loaders already have a cache.
I have read the loaders.py, and, as far as I can see, the cache is *inside*
the loader instance.
This means that the cache is destroyed when the loader istance goes out of
the scope; the document is reloaded every time render_main is called.
I see you are actually saving the loader in self.state and this wouldn't let
the loader die. Anyway you just need to provide another class variable for the
loader, seems easy.
_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web