From e1f1231936ab7f94bdfd1769b95a10e3460e1603 Mon Sep 17 00:00:00 2001 From: jordan Date: Mon, 2 Apr 2012 20:05:13 +0000 Subject: [PATCH] OSQA-824: Enable Django template caching Django loads and parses templates for every request, so this significantly improves OSQA performance. * I've checked over the custom template tags for thread safety and they look fine, so this change should be safe: https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#template-tag-thread-safety * Profiling indicated the other major contributor to CPU/request time was Django's lack of database connection pooling/persistent connections. That's best handled with an external daemon: http://meta.osqa.net/questions/11381/is-osqa-cpu-bound git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1238 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/settings.py b/settings.py index c895381..394486a 100644 --- a/settings.py +++ b/settings.py @@ -10,10 +10,12 @@ SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' CACHE_MAX_KEY_LENGTH = 235 TEMPLATE_LOADERS = [ + ('django.template.loaders.cached.Loader',( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', 'forum.modules.template_loader.module_templates_loader', 'forum.skins.load_template_source', + )), ] MIDDLEWARE_CLASSES = [ -- 2.45.1