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 <[email protected]> wrote:
>
> 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.
>
> 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.
>
>
> http://docs.djangoproject.com/en/1.2/topics/cache/#the-per-site-cache
>
> --
> -- Christophe Pettus
> [email protected]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<django-users%[email protected]>
> .
> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.