I’m running memcached infront of django without any explicit configuration in my code. I.e. nothing more than
MIDDLEWARE_CLASSES = (
'django.middleware.cache.UpdateCacheMiddleware',
...
'django.middleware.cache.FetchFromCacheMiddleware',
)
and
CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
in my settings.py. This works great, in fact so great that it’s caching my admin page leaving me no way to moderate live actions on the site until the cache refetches the data. Is there a regex I can throw somewhere to let memcached know to leave my admin page alone? (I’m also using nginx and gunicorn)
You can maybe write your own middleware class or extend from one that django provides.
Specify a dictionary of urls in your settings file:
Write a Middleware Class:
Alex Holt has a pretty neat tutorial about django, memcached and Nginx maybe you wanna read through that to get a better idea.