From 9507d5ac4b45d15e2a41bd7e39fd59e1d007ca83 Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Sun, 28 Aug 2011 11:21:37 +0200 Subject: [PATCH] euscanwww: enable caching Signed-off-by: Corentin Chary --- euscanwww/settings.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/euscanwww/settings.py b/euscanwww/settings.py index bf50ddd..d6de135 100644 --- a/euscanwww/settings.py +++ b/euscanwww/settings.py @@ -27,7 +27,14 @@ MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(os.path.dirname( __file__ ), 'euscan.db'), + 'NAME': os.path.join(os.path.dirname( __file__ ), 'euscan.db') + }, +} + +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', + 'LOCATION': os.path.join(os.path.dirname( __file__ ), 'euscan.cache'), } } @@ -82,12 +89,17 @@ TEMPLATE_LOADERS = ( MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', + 'django.middleware.cache.UpdateCacheMiddleware', + 'django.middleware.cache.FetchFromCacheMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) +CACHE_MIDDLEWARE_SECONDS=3600 +CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True + ROOT_URLCONF = 'euscanwww.urls' FORCE_SCRIPT_NAME=""