>The code is below, all you have to do is call >install_loader_cache()
>when your app starts (in the urls perhaps) and use >render_to_response
>from this package when rendering output (the default one has >an old
>reference to get_template so it won't use the cache until this >feature
>gets included in Django).

You might have written this as a simple template loader - and used the
basic template loaders as starting point, just overloading the
get_template functionality. That way you would be able to use the
standard render_to_xxx functions - you only would have to change the
TEMPLATE_LOADERS setting. And that way integration with the Django core
is quite simple, as it is just another bunch of template loaders the
user can just activate.

One more thing: maybe you need to protect your "cache" global with
locks, because otherwise this might produce funny results in
multithreaded situations. Or use the Django cache API, so people can
switch between different caching backends like memcached (which would
make the cached templates available to all processes at once) or local
memory (which would be similar to your code).

Yes, I understand that you needed a fast hack for your problem and
aren't maybe too interested into hacking more on this, so see this more
as possible "implementation notes" for people who take up from this
idea ;-)

bye, Georg

Reply via email to