Most of highly trafficked and highly commented wordpress blogs rely upon some smart caching solution or another.大部分被販賣的高度和高度評價WordPress Blogs的依靠一些智能緩存解決方案,或其他。 However it may not be enough to prevent slowing down your server if your post(s) are heavily commented upon.但它可能沒有足夠的,以防止放緩,您的服務器,如果您的帖子( S )的大量評論。 This is because smart caching solutions re-create the cache whenever a new comment is posted.這是因為智能緩存解決方案,重新建立緩存每當一個新的評論是張貼。 Here is a simple solution in three steps.這裡是一個簡單的解決方案在三個步驟。

Steps:步驟:

  1. Install (and activate)安裝(並激活) Wp-Cache 2可濕性粉劑緩存2 plugin.插件。 I have excellent experience with it for over a year.我有很好的經驗,與它超過一年。
  2. Modify wp-cache-phase2.php (one of the plugin files) to comment / delete the line:修改可濕性粉劑-緩存phase2.php (其中的插件文件)評論/刪除行:
    add_action('comment_post', 'wp_cache_get_postid_from_comment', 0); add_action ( ' comment_post ' , ' wp_cache_get_postid_from_comment ' , 0 ) ;
  3. Set the cache expiration time to 2 hours or more.設置緩存到期時間為2小時或以上。 This can easily handle a slashdot effect without breaking a sweat.這可以輕鬆地處理Slashdot的效果打破了汗水。

The change in step 2 ensures that the pages are not regenerated everytime a new comment is posted.變化在第2步確保該網頁不會再生,每次一個新的評論是張貼。 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.這個時間差可以節省大量的SQL查詢時,後是大量的評論。