Wednesday, December 28, 2011

CACHE_MIDDLEWARE_ANONYMOUS_ONLY isn't working for me

I have CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True. It seems to cache pages
even for people who have logged in. For example, I can log into the
admin, and edit an object. If I then visit the view for that app, my
changes do not get seen until the 5 minute cache timeout hits.

I suspect my middleware order is not correct, but I have read and re-
read the docs and I'm still confused.

Here are my cache related settings:

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')

Does anyone see anything wrong or have suggestions on how to debug
this?

Thanks,
BN

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment