• Resolved awhig

    (@awhig)


    Hi,

    My homepage is cached (in the page cache), but does not ever stayed cached for more than a minute or so. It is because I have the default options set in the Purge Policy, which includes purging the homepage cache “when posts are created, edited, or comments posted”.

    I’m not creating or editing posts at all, but I am getting 1 or 2 spam comments every minute or so on my site. These spam comments cause my homepage to be purged and regenerated.

    It would be a great benefit to not have the homepage (or any page) be purged if a spam comment is received, as opposed to a posted, or pending comment (we actually moderate all of our comments due to too much spam, so any “good” comment goes straight to pending status).

    I’m not sure what hooks are available to the w3tc plugin, so maybe it’s not possible to know if the comment is a “good” comment (as opposed to just any comment) at the time w3tc does its check to purge the cache, but I think this would be a great improvement for performance. Instead of invalidating our homepage every other minute, we’d have a long lived homepage in our cache (since we only get a handful of valid comments a day)…

    Thanks for your help. Great plugin!.

    Rich

    https://www.ads-software.com/extend/plugins/w3-total-cache/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter awhig

    (@awhig)

    Also,

    Maybe don’t even purge the selected page in the purge policy even when a “Pending” comment is received. We also get a lot of spam that slips through the filter, so we have to manually mark those as spam, since we moderate all our comments.

    So, I guess my request not actually purge the cache unless a comment gets published, as opposed to just “received”.

    Again, I’m not sure the WP API supports this, but if it does, then I think this makes more sense to do instead of the current functionality, which is to purge upon the receiving of a comment.

    Also, sorry if I’m completely wrong on how w3tc is currently working. I haven’t looked through that part of the code, but just basing my suggestions on what I *think* is happening after trying to debug my caching issue.

    Rich

    I guess my request not actually purge the cache unless a comment gets published, as opposed to just “received”.

    I encountered this problem a while ago and hacked W3TC to work around that:

    https://technology.bernews.com/w3tc-page-cache-and-spam-comments/

    css:

    #etalage .etalage_thumb_active{border:none}

    Thread Starter awhig

    (@awhig)

    Oh man, I made your changes to my installation and its working beautifully.

    My homepage now has been cached for over 10 minutes now. A NEW WORLD RECORD! I’ve never had it be cached for more than 2 or 3 minutes ever TOPS!

    I really think this should be made a permanent change to the plugin.

    If anyone is listening, please consider making these changes part of the official plugin release.

    Thanks,
    Rich

    Thread Starter awhig

    (@awhig)

    Marking this resolved.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: W3 Total Cache] Homepage does not stay cached for long due to spam comments’ is closed to new replies.