First time here? Check out the FAQ!

Revision history  [back]

[I will update these instructions if Evgeny tells me otherwise.]

Follow the memcache setup instructions described here: http://docs.webfaction.com/software/memcached.html and make sure python-memcached is installed.

Then, put the following in your settings.py:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': 'unix:/home/USERNAME/memcached.sock',
        'TIMEOUT': 18000,
        'KEY_PREFIX': 'askbot',
    }
}
CACHE_TIMEOUT = 18000
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True

And disable the current CACHE_BACKEND. (The second CACHE_TIMEOUT is necessary because of a small bug.)

Also, disable the following middleware:

'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',

Otherwise you will get errors, like entire pages being cached when they shouldn't.

[I will update these instructions if Evgeny tells me otherwise.]

Follow the memcache setup instructions described here: http://docs.webfaction.com/software/memcached.html and make sure python-memcached is installed.

Then, put the following in your settings.py:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': 'unix:/home/USERNAME/memcached.sock',
        'TIMEOUT': 18000,
        'KEY_PREFIX': 'askbot',
    }
}
CACHE_TIMEOUT = 18000
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True

And disable the current CACHE_BACKEND. (The second CACHE_TIMEOUT is necessary because of a small bug.)CACHE_BACKEND.

Also, disable enable the following middleware:

'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',

Otherwise you will get errors, like entire pages being cached when they shouldn't.