Title: [Plugin: Quick Cache ( A WP Super Cache Alternative )] Clear a post&#039;s cache when someone commen
Last modified: August 19, 2016

---

# [Plugin: Quick Cache ( A WP Super Cache Alternative )] Clear a post's cache when someone commen

 *  [arvincastro](https://wordpress.org/support/users/arvincastro/)
 * (@arvincastro)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-quick-cache-a-wp-super-cache-alternative-clear-a-posts-cache-when-someone-comments/)
 * Is there a way to clear a specific cached post or page when someone posts a comment?
 * My blog is not very active so I set the cache expiration to 5 days, but I want
   that the cache for a post to be refreshed when someone comments, which is also
   rare.
 * [http://wordpress.org/extend/plugins/quick-cache/](http://wordpress.org/extend/plugins/quick-cache/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [arvincastro](https://wordpress.org/support/users/arvincastro/)
 * (@arvincastro)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-quick-cache-a-wp-super-cache-alternative-clear-a-posts-cache-when-someone-comments/#post-1901143)
 * Solve it, hehe. Just added this code to my theme’s functions.php file.
 *     ```
       add_filter("comment_post_redirect", "ws_plugin__qcache_clear_on_post_page_comment", 10, 2);
       function ws_plugin__qcache_clear_on_post_page_comment($location, $comment) {
       	ws_plugin__qcache_clear_on_post_page_creations_deletions($comment->comment_post_ID);
       	return $location;
       }
       ```
   
 * then edited wp-content/plugins/quick-cache/includes/functions/clearing-routines.
   inc.php, edited the ws_plugin__qcache_clear_on_post_page_creations_deletions 
   function:
 * Changed line 34 to (Quick Cache v2.2.7):
 * `if (in_array ($pagenow, ($pages = array ("edit.php", "post.php", "post-new.php","
   wp-comments-post.php"))))`
 * *added ‘wp-comments-post.php’ in the whitelist
    This will clear the cache for
   this specific post. and, depending on settings, will clear the cache for the 
   home page also.
 *  [Pr0t0c0L2010](https://wordpress.org/support/users/pr0t0c0l2010/)
 * (@pr0t0c0l2010)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-quick-cache-a-wp-super-cache-alternative-clear-a-posts-cache-when-someone-comments/#post-1901480)
 * i try this and in my case just dont work. i got lots of errors when i post a 
   news comment.
 *  Thread Starter [arvincastro](https://wordpress.org/support/users/arvincastro/)
 * (@arvincastro)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-quick-cache-a-wp-super-cache-alternative-clear-a-posts-cache-when-someone-comments/#post-1901482)
 * The function to clear the cache was changed in the recent version of the plugin.
   And I haven’t found a solution yet for it.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Quick Cache ( A WP Super Cache Alternative )] Clear a post's
cache when someone commen’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/quick-cache_efefef.svg)
 * [Quick Cache (Speed Without Compromise)](https://wordpress.org/plugins/quick-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/quick-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/quick-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/quick-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/quick-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/quick-cache/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [arvincastro](https://wordpress.org/support/users/arvincastro/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-quick-cache-a-wp-super-cache-alternative-clear-a-posts-cache-when-someone-comments/#post-1901482)
 * Status: not resolved