描述
If we can make this work, this should substantially improve page load times in development with pretty minimal cost (just a bit of extra complexity).
Larger pages like / and /integrations are way faster in prod because of this block in zproject/settings.py:
if PRODUCTION:
# Template caching is a significant performance win in production.
TEMPLATE_LOADERS = (
('django.template.loaders.cached.Loader',
TEMPLATE_LOADERS),
)
So most of the processing it only does once per template rather than once per request. We can't use that in development right now, because the way that caching works it doesn't update the cache when a user changes the template content. It should be possible to add a mechanism for invalidating that cache whenever changes are made in the repository (we certainly already have autoreload code listening for changes to frontend templates in tools/compile-handlebars-templates, and it shouldn't hard to tweak that to do Django templates as well; we just need to read the Django cached loader's code to find out what we need to do in order to update/invalidate the cache).
Based on a follow-up to #545.