Valentino Volonghi aka Dialtone ha scritto:


On Wed, 21 Feb 2007 12:32:08 +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.



Regards  Manlio Perillo

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to