I'm playing with comment caching using the latest patch, and I'm not sure I get why it works the way it does. Here's what I'm seeing:

For EVERY page load, it does a pager_query to retrieve the comments for the current page, then does a cache_set caching all of the comments for the page, followed by one individual query for each comment on the page (10 queries for 10 comments) finally ending with one more cache_set for the pager.

That's a whole lot of stuff going on for every page load. Is this the way things are supposed to work?

Comments

ilmaestro’s picture

I've been meaning to follow up here. Not knowing much about what was going on when I wrote this, I've since found out that those individual queries per comment were cache_filter queries.

Since I still want to have filtering of my comments, but don't want to run them through filtering and don't want to have to retrieve each filtered comment from cache, what I did was move the cache_set call in render_comments down to AFTER we've filtered the comment (after the theme calls). So all of my cached comments are now pre-filtered.

Not sure what you guys think of this approach, but with comment filters and cache filtering enabled, one query per comment is just ridiculous.

robertDouglass’s picture

If you could provide a patch, that'd be great.

firebus’s picture

Title: Comment caching? » Cache comments after filtering
Category: support » task