WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
Does removing spam comments clears the cache? (19 posts)

  1. talgalili
    Member
    Posted 2 years ago #

    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/

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  3. talgalili
    Member
    Posted 2 years ago #

    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 :)

  4. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    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. :(

  5. talgalili
    Member
    Posted 2 years ago #

    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

  6. talgalili
    Member
    Posted 2 years ago #

    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

  7. talgalili
    Member
    Posted 2 years ago #

    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 :D

    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

  8. chadrew
    Member
    Posted 2 years ago #

    I am pretty sure WP Super Cache already clears the homepage when a new post is made.

  9. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    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 ?

  10. talgalili
    Member
    Posted 2 years ago #

    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

  11. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  12. talgalili
    Member
    Posted 2 years ago #

    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.

  13. talgalili
    Member
    Posted 2 years ago #

    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"

  14. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    Good idea, thanks!

  15. talgalili
    Member
    Posted 2 years ago #

    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").

  16. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    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..

  17. talgalili
    Member
    Posted 2 years ago #

    Hi Donncha,

    As far as I can see, there is an option to turn the syncing off.

  18. talgalili
    Member
    Posted 2 years ago #

    Hi Donncha,

    I have turned the sync off, and in wp-super-cache I turned off the option to refresh the cache when a new comment is made. But still, it refreshed this page (after a new comment was made today):

    http://www.r-statistics.com/2011/11/edimax-ew-7811un-usb-wireless-connecting-to-a-network-on-ubuntu-11-10/

    And what is even more weird, is that here:
    http://www.talgalili.com/2007/10/91

    I have the same setting - but the comment didn't trigger the cache to be emptied (so this should be able to work all the time)

    Is there anything I can do so to keep it static? Might I be missing something?

    Thanks!

  19. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    You could enable debugging and then leave a comment and see what happens on the log? That should tell you a lot.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic