I’m going to use a hybrid of WP-Discourse + Embedded Comments via JS on our blog.
I’d like to show the number of replies / comments each post has, at least within the single post (
single.php), but don’t want to slam the Discourse API 10,000+ times per day or slow the blog down while it retrieves that.
Does anyone have any good strategies for getting and saving the
reply_count so that we don’t hit the server too often, or slow the blog from loading too often?
Are there good methods of “caching” the reply_count in post_meta / custom fields, and only updating it if it’s requested and the cache date is X hours old?
Or perhaps a cron job that just goes through all posts and updates regularly without slowing down the site ever?
Any other ideas? This is more of a WordPress strategy than anything.