On 2/2/06, Wojtek/brandlay.com <[EMAIL PROTECTED]> wrote: > Sure, below is the tag which I use for including a template. The > template which is included is cached by my caching mechanism.
One suggestion that comes to mind is in the "else" clause: Instead of loading the template there, load it in the compilation step (do_tagname()) and pass the compiled template to the Node's __init__(). You can do this because the template name in that case doesn't depend on data in the current template; in other words, there's no reason to wait until the render() phase to load the template. > I've just noticed that the caching mechanism only caches the innermost > template in the inheritance tree. So the templates from which I > inherit are reparsed at each request. Any idea how to cache everything? I suspect the problem there is the template-cache patch you had was a bit of a monkey patch -- it edited template.loader.get_template in memory. A nice solution would be to add a "cache" keyword argument to get_template(), as I proposed in that thread: http://groups.google.com/group/django-users/browse_thread/thread/40ecfffa8aa85a21/759da88e6d075ad7 Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org