Re: Caching middleware causes default page caching
yes, I mistakenly thought I need middleware to cache db objects. I guess following is enough for my needs,
CACHE_BACKEND = 'locmem://'
from django.core.cache import cache
and cache.set('add_key', 'Initial value')
>>> cache.add('add_key', 'New value')
>>> cache.get('add_key')
thanks
On Fri, Nov 26, 2010 at 9:02 PM, Christophe Pettus <xof@thebuild.com> wrote:
Unless I'm missing something, that's exactly what it is supposed to be doing. The cache middleware caches your entire site, all the time, by default. If all you want to do is use the cache framework to store some database objects, you don't need the cache middleware.
On Nov 26, 2010, at 8:30 PM, ydjango wrote:
> I have added following to cache some common DB data and it seems it
> has started caching whole pages by default. Some pages appeared to be
> retrieved from cache without even hitting the view.
http://docs.djangoproject.com/en/1.2/topics/cache/#the-per-site-cache
--
-- Christophe Pettus
xof@thebuild.com
--
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.
--
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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home