Skip to content

Commit 07e93b5

Browse files
committed
Updated the caching settings to use memcached in production.
- Legacy-Id: 7232
1 parent 85237c6 commit 07e93b5

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

ietf/settings.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,23 @@
277277
# Override this in settings_local.py if needed
278278
CACHE_MIDDLEWARE_SECONDS = 300
279279
CACHE_MIDDLEWARE_KEY_PREFIX = ''
280+
281+
# The default with no CACHES setting is 'django.core.cache.backends.locmem.LocMemCache'
280282
if SERVER_MODE == 'production':
281-
CACHE_BACKEND= 'file://'+'/a/www/ietf-datatracker/cache/'
282-
else:
283-
# Default to no caching in development/test, so that every developer
284-
# doesn't have to set CACHE_BACKEND in settings_local
285-
CACHE_BACKEND = 'dummy:///'
286283

287-
# For readonly database operation
288-
# CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
289-
# SESSION_ENGINE = "django.contrib.sessions.backends.cache"
284+
CACHES = {
285+
'default': {
286+
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
287+
'LOCATION': '127.0.0.1:11211',
288+
}
289+
}
290+
else:
291+
# Default to no caching in development/test
292+
CACHES = {
293+
'default': {
294+
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
295+
}
296+
}
290297

291298
IPR_EMAIL_TO = ['ietf-ipr@ietf.org', ]
292299
DOC_APPROVAL_EMAIL_CC = ["RFC Editor <rfc-editor@rfc-editor.org>", ]

0 commit comments

Comments
 (0)