I'm using the lcf_recent_comments and WP-cache plugins, but every time the cache is refreshed (due to a new comment or something), I get a spike in database calls from the recent comments plugin (as each page separately updates the recent comments list) - each search is over roughly 33,000 comments, and the number of active pages is a few tens to hundreds. This has caused our host to pull the plug temporarily due to 'database instabilities'.
It seems to me it would be better if the recent comment list would be read in from a file that was generated just once when the cache was refreshed. My idea is to create a new file 'recent_comments.php' in the theme directory which contains just:
<ul> <? lcf_get_recent_responses(5,10,'<li>','</li>','false') ?> </ul>
and then in the index.php file, have:
load_template( TEMPLATEPATH . '/recent_comments.php');
My question is, will this work? (i.e. will recent_comments.php be generated just once and then read in from the cache?). (My ability to test is limited since I don't have database access right now).
Any hints/suggestions welcome.