>Any mechanism that caches in memory means that you'll have to do
>something fancy (or just restart your server) to ensure changes to
>templates are picked up. Why bother with this problem at all unless
>template performance becomes an issue?

Not really. What would be doable would be to use the changetime of the
template as a cache parameter - that way you see wether there was a
change between the template and the file. You would only need to read
directories instead of whole files. But you still would have the
problem that you are diskbound with your templating (that's actually
the biggest gripe I have with allways reading and allways compiling,
you make the django app process disk bound).

That can be easily circumvented by using my DbTemplate loader, though.
In that case you aren't diskbound any more, but are database bound -
but you are database bound anyway, so you better solve _that_ problem
by using a honking big fat machine for the database if this get's a
problem ;-)

I think any caching should be done in the template loader anyway - for
example you could write a template loader that caches in memcached.
That would be useful for production environments where templates don't
change that often.

It could be nice to enhance the template loader interface so that
temlate loaders could store the compiled template, too - so they can
store the compiled template instead of the uncompiled template, if they
see the need.

bye, Georg

Reply via email to