On Tue, 2007-12-18 at 15:47 +0100, Michael Elsdörfer wrote: > James Bennett schrieb: > > Manually call get_template() or select_template(), and stuff the > > resulting Template object into a module-global variable somewhere. > > Then just re-use it, calling render() with different contexts, each > > time you need it. > > Is there anything speaking against building that behaviour directly into > Django?
In the early days of Django, Adrian, Simon et al looked at that. It wasn't worth it, since, in the grand scheme of things, template caching and checking the cache wasn't that much faster than loading and parsing, particularly in the overall response time of a request (of which template parsing is a relatively small component). Adding complexity for minimal gain isn't usually a good idea. Unless this is a universal win, it would be better to write it as a third-party template loader. It's fairly easy to write a template loader that takes another template loader as a parameter and just wraps caching around it and that keeps the core code cleaner. Regards, Malcolm -- The cost of feathers has risen; even down is up! http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---