diff --git a/coinmanager/coinmanager/production_settings.py b/coinmanager/coinmanager/production_settings.py index 2027724..375e179 100644 --- a/coinmanager/coinmanager/production_settings.py +++ b/coinmanager/coinmanager/production_settings.py @@ -47,6 +47,7 @@ MIDDLEWARE = [ 'django.middleware.common.CommonMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', + 'django.middleware.http.ConditionalGetMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', @@ -142,4 +143,4 @@ CACHES = { # caching CACHE_MIDDLEWARE_ALIAS = 'default' -CACHE_MIDDLEWARE_SECONDS = 600 +CACHE_MIDDLEWARE_SECONDS = 60*60*24*7 diff --git a/coinmanager/coinmanager/settings.py b/coinmanager/coinmanager/settings.py index 2300e81..2b5ddae 100644 --- a/coinmanager/coinmanager/settings.py +++ b/coinmanager/coinmanager/settings.py @@ -44,7 +44,9 @@ INSTALLED_APPS = [ MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.common.CommonMiddleware', + 'django.middleware.cache.FetchFromCacheMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', @@ -126,3 +128,7 @@ MAINTENANCE_MODE_READ_ONLY = False # do not redirect after login LOGIN_REDIRECT_URL = './' + +# caching +CACHE_MIDDLEWARE_ALIAS = willipink_coinc +CACHE_MIDDLEWARE_SECONDS = 600