How To Improve Performance of Highly Commented WordPress BlogsBy Angsuman Chakraborty, Gaea News Network
Wednesday, April 26, 2006
Most of highly trafficked and highly commented wordpress blogs rely upon some smart caching solution or another. However it may not be enough to prevent slowing down your server if your post(s) are heavily commented upon. This is because smart caching solutions re-create the cache whenever a new comment is posted. Here is a simple solution in three steps.
- Install (and activate) Wp-Cache 2 plugin. I have excellent experience with it for over a year.
- Modify wp-cache-phase2.php (one of the plugin files) to comment / delete the line:
add_action('comment_post', 'wp_cache_get_postid_from_comment', 0);
- Set the cache expiration time to 2 hours or more. This can easily handle a slashdot effect without breaking a sweat.
The change in step 2 ensures that the pages are not regenerated everytime a new comment is posted. They are however regenerated after the expiration of cache. This time lag saves an enormous amount of sql query when a post is heavily commented.