I have a site that uses the standard Django Comments app (well, a subclass
of it, with not many changes) for comments on different content types.

I'd like to be able to cache a list of comments, as fetching the comments
is one of the most frequent and slowest queries that's happening at the
moment.

But I can't see the simplest way to perform this caching. (I'm already
using the per-site cache for logged-out users and per-view cache on a few
views, using memcache.)

At the moment the queryset comes from RenderCommentListNode's render()
method <
https://github.com/django/django/blob/stable/1.5.x/django/contrib/comments/templatetags/comments.py#L200>
So I could subclass RenderCommentListNode, copy the render() method, and
add caching there... but it feels a bit clunky and hacky compared to most
customising I end up doing with Django these days... so is this the
best/only way?

Phil

-- 
http://www.gyford.com/

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


Reply via email to