best framework/reusable app for caching model instances (object level cache) ?

16 views
Skip to first unread message

stargazer

unread,
May 9, 2011, 11:08:54 AM5/9/11
to Django users
What is the best framework/library/reusable app for caching model
instances in Django? (This approach is also known as transparently
object cache, ORM cache, row-level object cache, object level cache)

The are reausable apps implementing this. The problem is there are so
many of them! Here what I found (probably even more exist):
http://github.com/mmalone/django-caching/
http://github.com/dcramer/django-orm-cache
http://github.com/dziegler/django-cachebot
http://bitbucket.org/jmoiron/johnny-cache
http://github.com/jbalogh/django-cache-machine
http://github.com/SeanHayes/django-query-caching

I do not want test every library, just want to peek one that do the
job, that solve more problems than it creates ("There are only two
hard problems in Computer Science: cache invalidation and naming
things")

Please share your experience

stargazer

unread,
May 17, 2011, 12:36:53 PM5/17/11
to Django users
After looking at these libraries... I think the best solution would be
not use these kind of libraries (ORM cache) at all.

The @cached decorator like from this library:
https://bitbucket.org/kmike/django-cache-utils
caches ***and invalidates!*** function based on function name and
exact parameter set.

my idea is to add @cached decorators to the model manager methods and
call ...invalidate for these methods in post_save() and pre_delete()
Some manual work required, but the end result is quite transparent.

Somebody use this approach?

Nan

unread,
Jun 8, 2011, 1:45:21 PM6/8/11
to Django users

I'm looking into caching options at the moment too. Did you end up
using django-cache-utils? Is it working out for you?

On May 17, 12:36 pm, stargazer <stranger....@gmail.com> wrote:
> After looking at these libraries... I think the best solution would be
> not use these kind of libraries (ORMcache) at all.
Reply all
Reply to author
Forward
0 new messages