Summary: Cache template loading (speeds up some pages by 20-50 ms),

but only on production since it is really annoying while developing
 - Legacy-Id: 8969
This commit is contained in:
Ole Laursen 2015-02-04 14:28:47 +00:00
parent 12faa4a2f8
commit 86c6effc55

View file

@ -148,8 +148,10 @@ SESSION_EXPIRE_AT_BROWSER_CLOSE = False
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
('django.template.loaders.cached.Loader', (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)),
'ietf.dbtemplate.template.Loader',
)
@ -495,6 +497,9 @@ INSTALLED_APPS += DEV_APPS
# secret key has been provided elsewhere, not in this file which is
# publicly available, for instance from the source repository.
if SERVER_MODE != 'production':
# stomp out the cached template loader, it's annoying
TEMPLATE_LOADERS = [l for e in TEMPLATE_LOADERS for l in (e[1] if isinstance(e, tuple) and "cached.Loader" in e[0] else (e,))]
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',