2009/5/21 Jarek Zgoda <jarek.zg...@redefine.pl>

> Use low-level Django cache framework to cache retrieved object but
> don't forget to invalidate the cache upon each change to this object.
> Like:
>
> obj = cache.get(obj_key)
> if not obj:
>     obj = ObjClass.objects.get(pk=obj_pk)
>     cache.set(obj_key, obj)
> return obj
>

It's really that straight-forward,  what a nice surprise!

Thanks,
Mark


> --
> Artificial intelligence stands no chance against natural stupidity
>
> Jarek Zgoda, R&D, Redefine
> jarek.zg...@redefine.pl
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to