on my server I have one project in Django with combination Nginx + Gunicorn. I use memcached in this project and it works fine to me.
Now I would like to add next project. Everything is fine since I add caching to my new project. Then this two projects are overwritting cache of the other one. When I go to page of one project, I see the second.
In my settings.py I have:
MIDDLEWARE_CLASSES = (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
...
and
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backend.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
What have I wrong?
Change the value of
CACHE_MIDDLEWARE_KEY_PREFIXin your settings. It should be unique for each project.