Title: [Plugin: WP Super Cache] Does removing spam comments clears the cache?
Last modified: August 20, 2016

---

# [Plugin: WP Super Cache] Does removing spam comments clears the cache?

 *  [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/)
 * Hello dear Donncha,
 * I am using wp-super-cache on one of my blogs where I do not post often (www.r-
   statistics.com).
    In it, I set the expiration date of the cache to “0” (meaning,
   if I got it right – keep them forever). But I also said to clear the cache I 
   publish a post or clear it if a comment is added.
 * However, I have just got a comment held for moderation. The comment was spam 
   and I marked it as spam. But when I went to view the caching of the site, I noticed
   that the homepage (and the post on which the comment was submitted) had their
   cache refreshed.
 * Shouldn’t it be that the cache refreshes only when a comment is posted (not marked
   as spam)? Or did the cache clear because I was an admin or something of this 
   sort? (I also looked at the cache from incognito mode from chrome)
 * Cheers,
    Tal
 * [http://wordpress.org/extend/plugins/wp-super-cache/](http://wordpress.org/extend/plugins/wp-super-cache/)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/page/2/?output_format=md)

 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409724)
 * Unfortunately it does clear some of the cache as you found out. There’s no way
   for the plugin to find out if the comment was moderated or not as it’s deleted
   BEFORE the plugin does anything. At least from what I remember anyway.
 *  Thread Starter [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409745)
 * Thanks Donncha. That is a bummer, but not too much…
 * BTW, I’ve got two feature requests to suggest:
    1) Clear “the homepage” (or maybe
   also the category/tags) when a post or page is published (and nor remove ALL 
   cached files). 2) Set different expiry time for homepage vs other types of pages
 * Thank you – I really love your plugin 🙂
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409755)
 * 1. When a post is made the homepage is cleared and possibly some other pages 
   too but the whole cache is deleted ONLY when you select an option on the Advanced
   settings page.
    2. It’s on the TODO list but it’ll be a pain to implement. 🙁
 *  Thread Starter [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409756)
 * Hi Donncha,
 * Regarding 2 – oh well…
 * Regarding 1 – any chance you would flush these options out? Currently, I suspect
   this does not always happen (when I have tested it) – and I would love to see
   it clearly presented as an option so I could tinker with it to my needs.
 * With regards,
    Tal
 *  Thread Starter [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409766)
 * Hi Donncha,
 * One more question – does the preload option includes the homepage?
    Is it possible
   to exclude it?
 * I tried setting the preload expiry time to 0, and the rest of the cache to 1800.
   Yet I see that my homepage doesn’t refresh after several hours.
 * (The website is r-bloggers.com)
 * I just set the homepage to not cache – but it is not an ideal solution 🙁
 * Thanks,
    Tal
 *  Thread Starter [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409767)
 * I seem to be getting to this over and over – that what I need is a “clear the
   cache of homepage/tag/category/search when a new post is published”…
 * I am sorry that I am repeating myself 😀
 * If you have any ideas of how to achieve something similar to that in the current
   plugin – I’d be very happy to know about it!
 * With regards,
    Tal
 *  [chadrew](https://wordpress.org/support/users/chadrew/)
 * (@chadrew)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409772)
 * I am pretty sure WP Super Cache already clears the homepage when a new post is
   made.
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409777)
 * After all the posts are preloaded the plugin cleans up any “old” cached files.
   This should include the homepage. Did you check the actual cached file in cache/
   supercache/xxxx/index.html ?
 *  Thread Starter [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409781)
 * Hi Donncha,
    Thank you for getting back to me.
 * What do you mean when you say after ALL the posts are preloaded?
    So if I have
   10K posts, does that mean that the homepage is cleared only after they are ALL
   cached? (because that is my situation on some blogs)
 * Also, I have just noticed a behavior I didn’t know about (which was replicated
   successfully on two blogs):
    I look and see that I have wp-super-cache and wp-
   cache files, and also many spam comments. When I deleted the spam comments, all
   of my wp-cache files were deleted. (This is on blogs where I set the expiration
   time to be 0 on both preloaded and on “normal” cached files). Why is this happening?
   Is there any way to prevent from spam comments to have so much influence on my
   blog’s caching?
 * Thank you for looking into this Donncha,
    Best, Tal
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409784)
 * Yes, after all posts are preloaded then other older pages are cleared out.
 * That behaviour with the wp-cache files is expected unfortunately. It’s inherited
   code from the WP Cache plugin. Most people use the Supercache files so it hasn’t
   been a major problem. I don’t think I’ll have time to fix this problem any time
   soon, sorry.
 *  Thread Starter [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409786)
 * Hi Donncha,
 * Thank you for the answers.
 * I guess you understand my problem at this point – I hope you will add features
   so I could have the homepage refresh once in half an hour or so, while the rest
   of the website will stay cached.
 * Thanks.
 *  Thread Starter [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409793)
 * Hi Donncha,
 * Suggestion –
 * Consider changing the text:
    “Clear all cache files when a post or page is published”
   To “Clear all cache files when a post or page is published or updated”
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409802)
 * Good idea, thanks!
 *  Thread Starter [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409803)
 * Great 🙂
 * BTW Donncha,
    What about adding a recommendation for using disqus/intense-debate?
   If I understand it correctly – they allow one to keep a page cached while keeping
   the commenting functionality active (without the need to refresh the page with
   the comment, or the sidebar for “recent comments”).
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/#post-2409804)
 * Those services sync back to the WordPress site don’t they? Do they fire off the
   comment_post action when they do or do the plugins insert the comment directly?
 * If they cause the comment_post action to fire the plugin will clear the cached
   file for that post..

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/page/2/?output_format=md)

The topic ‘[Plugin: WP Super Cache] Does removing spam comments clears the cache?’
is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

 * 18 replies
 * 3 participants
 * Last reply from: [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-does-removing-spam-comments-clears-the-cache/page/2/#post-2409818)
 * Status: not resolved