From f7886df21263b715d9e3d3f728801ebe034e42ee Mon Sep 17 00:00:00 2001 From: Russ Housley Date: Tue, 19 May 2020 21:29:25 +0000 Subject: [PATCH] Create slowpages cache for some very stable pages - Legacy-Id: 17843 --- ietf/group/views.py | 4 ++-- ietf/settings.py | 17 ++++++++++++++++- ietf/settings_testcrawl.py | 8 ++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ietf/group/views.py b/ietf/group/views.py index 7979faa04..9e03b0ea6 100644 --- a/ietf/group/views.py +++ b/ietf/group/views.py @@ -251,7 +251,7 @@ def wg_summary_acronym(request, group_type): 'groups': groups }, content_type='text/plain; charset=UTF-8') -@cache_page ( 60 * 60 ) +@cache_page ( 60 * 60, cache="slowpages" ) def wg_charters(request, group_type): if group_type != "wg": raise Http404 @@ -268,7 +268,7 @@ def wg_charters(request, group_type): { 'areas': areas }, content_type='text/plain; charset=UTF-8') -@cache_page ( 60 * 60 ) +@cache_page ( 60 * 60, cache="slowpages" ) def wg_charters_by_acronym(request, group_type): if group_type != "wg": raise Http404 diff --git a/ietf/settings.py b/ietf/settings.py index dad223cc3..46feb1ead 100644 --- a/ietf/settings.py +++ b/ietf/settings.py @@ -715,6 +715,13 @@ CACHES = { 'MAX_ENTRIES': 100000, # 100,000 }, }, + 'slowpages': { + 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', + 'LOCATION': '/a/cache/datatracker/slowpages', + 'OPTIONS': { + 'MAX_ENTRIES': 5000, + }, + }, } HTMLIZER_VERSION = 1 @@ -1137,7 +1144,15 @@ if SERVER_MODE != 'production': 'OPTIONS': { 'MAX_ENTRIES': 1000, }, - } + }, + 'slowpages': { + 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', + #'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', + 'LOCATION': '/var/cache/datatracker/', + 'OPTIONS': { + 'MAX_ENTRIES': 5000, + }, + }, } SESSION_ENGINE = "django.contrib.sessions.backends.db" diff --git a/ietf/settings_testcrawl.py b/ietf/settings_testcrawl.py index 7dfb08f1b..8848c0933 100644 --- a/ietf/settings_testcrawl.py +++ b/ietf/settings_testcrawl.py @@ -35,6 +35,14 @@ CACHES = { 'MAX_ENTRIES': 100000, }, }, + 'slowpages': { + 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', + #'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', + 'LOCATION': '/var/cache/datatracker/slowpages', + 'OPTIONS': { + 'MAX_ENTRIES': 5000, + }, + }, } PASSWORD_HASHERS = [ 'django.contrib.auth.hashers.MD5PasswordHasher', ]