Skip to content
Snippets Groups Projects
Commit f11adfc2 authored by Alexander Pace's avatar Alexander Pace
Browse files

cherry picked caching settings

parent b667790d
No related branches found
No related tags found
1 merge request!46Refreshed look and feel
Pipeline #102944 passed
......@@ -84,20 +84,6 @@ AWS_SES_REGION_ENDPOINT = get_from_env('AWS_SES_REGION_ENDPOINT',
AWS_SES_AUTO_THROTTLE = 0.25
ALERT_EMAIL_FROM = get_from_env('DJANGO_ALERT_EMAIL_FROM')
# AWS Elasticache settings:
AWS_ELASTICACHE_ADDR = get_from_env('DJANGO_AWS_ELASTICACHE_ADDR')
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': AWS_ELASTICACHE_ADDR,
},
# For API throttles
'throttles': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'api_throttle_cache', # Table name
},
}
MIDDLEWARE = [
'core.middleware.maintenance.MaintenanceModeMiddleware',
......@@ -115,6 +101,21 @@ MIDDLEWARE = [
'ligoauth.middleware.ShibbolethWebAuthMiddleware',
'ligoauth.middleware.ControlRoomMiddleware',
]
#AWS_ELASTICACHE_ADDR = get_from_env('DJANGO_AWS_ELASTICACHE_ADDR')
#
#CACHES = {
# 'default': {
# 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
# 'LOCATION': AWS_ELASTICACHE_ADDR,
# 'TIMEOUT': 30,
# 'KEY_PREFIX': CONFIG_NAME,
# },
# # For API throttles
# 'throttles': {
# 'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
# 'LOCATION': 'api_throttle_cache', # Table name
# },
#}
# Priority server settings ----------------------------------------------------
......
......@@ -88,3 +88,20 @@ Events and associated data may change or be removed at any time.
<li>LVAlert messages are sent to lvalert-dev.cgca.uwm.edu.</li>
</ul>
"""
# AWS Elasticache settings:
AWS_ELASTICACHE_ADDR = get_from_env('DJANGO_AWS_ELASTICACHE_ADDR')
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': AWS_ELASTICACHE_ADDR,
'TIMEOUT': 30,
'KEY_PREFIX': "1",
},
# For API throttles
'throttles': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'api_throttle_cache', # Table name
},
}
......@@ -42,3 +42,20 @@ A nightly cron job removes events older than 21 days.</li>
# Safety check on debug mode for playground
if (DEBUG == True):
raise RuntimeError("Turn off debug mode for playground")
# AWS Elasticache settings:
AWS_ELASTICACHE_ADDR = get_from_env('DJANGO_AWS_ELASTICACHE_ADDR')
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': AWS_ELASTICACHE_ADDR,
'TIMEOUT': 30,
'KEY_PREFIX': '3',
},
# For API throttles
'throttles': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'api_throttle_cache', # Table name
},
}
......@@ -2,6 +2,7 @@
from .base import *
DEBUG = False
CONFIG_NAME="PROD"
# Turn on alerts
SEND_XMPP_ALERTS = True
......
......@@ -88,3 +88,20 @@ to Playground or Production. Note, on this GraceDB instance:
<li>LVAlert messages are sent to lvalert-test.cgca.uwm.edu.</li>
</ul>
"""
# AWS Elasticache settings:
AWS_ELASTICACHE_ADDR = get_from_env('DJANGO_AWS_ELASTICACHE_ADDR')
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': AWS_ELASTICACHE_ADDR,
'TIMEOUT': 30,
'KEY_PREFIX': '2',
},
# For API throttles
'throttles': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'api_throttle_cache', # Table name
},
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment