Mercurial > public > bravenewsurf
changeset 82:0e1f1e8db2a5
For issue #6, add caching to production settings.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 25 Nov 2011 20:30:48 -0600 |
parents | 4735fdc82b48 |
children | f320699478d7 |
files | bns_website/settings/production.py |
diffstat | 1 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/bns_website/settings/production.py Fri Nov 25 20:03:19 2011 -0600 +++ b/bns_website/settings/production.py Fri Nov 25 20:30:48 2011 -0600 @@ -14,6 +14,22 @@ }, } +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'LOCATION': '127.0.0.1:11211', + 'TIMEOUT': 600, + }, +} + +CACHE_MIDDLEWARE_ALIAS = 'default' +CACHE_MIDDLEWARE_SECONDS = 600 +CACHE_MIDDLEWARE_KEY_PREFIX = 'BNS' +CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True + +MIDDLEWARE_CLASSES.insert(0, 'django.middleware.cache.UpdateCacheMiddleware') +MIDDLEWARE_CLASSES.append('django.middleware.cache.FetchFromCacheMiddleware') + LOGGING = { 'version': 1, 'disable_existing_loggers': True,