• Resolved massimod

    (@massimod)


    It seems that my home page is cleared on a daily basis. I haven’t touched my site for a week or so, still …

    Any ideas what to search for ?

    Thanks

Viewing 15 replies - 1 through 15 (of 18 total)
  • Raam Dev

    (@raamdev)

    @massimod It sounds like you have another plugin installed that’s firing a hook on a daily basis that Comet Cache attaches to as a sign that the Home Page cache needs to be cleared.

    Here’s a list of actions that Comet Cache hooks into in various ways:
    https://github.com/websharks/comet-cache/blob/170220/src/includes/classes/Plugin.php#L490-L551

    However the easiest way to find the culprit will likely be to disable other plugins one-by-one until you find the one that’s causing Comet Cache to clear the cache.

    Thread Starter massimod

    (@massimod)

    As i said i haven’t changed/added/touched my site for a week or two.

    And disabling one by one plugins and wait 24 hours, will take … hmmm …. 23 days exactly.

    Can’t do that.

    Thread Starter massimod

    (@massimod)

    I have a widget in the footer of my home page. Showing Recent Questions and Answers from a plugin. No new Questions or anything happening, but could that be the cause ?

    Could a plugin just cause cache clearning without supporting Comet Cache ?

    Raam Dev

    (@raamdev)

    Could a plugin just cause cache clearning without supporting Comet Cache ?

    Yes, any plugin that you install in WordPress could trigger any of the WordPress hooks that Comet Cache listens for, which means that any other plugin is capable of causing Comet Cache to clear the cache without that plugin having any knowledge of Comet Cache.

    This is all made possible by the WordPress Plugin API, which makes it possible to build plugins that integrate tightly into the entire WordPress platform. That means if, for example, a plugin that knows nothing about Comet Cache saves a post in WordPress, Comet Cache should automatically know that it needs to clear the cache for the post that was just saved. This is both good and bad. It’s good because it means automatic integration with nearly all other WordPress plugins, but it can be bad if other plugins fire hooks without considering the greater effects to the rest of the WordPress site.

    Thread Starter massimod

    (@massimod)

    @raam Dev

    Please help on this. I can’t figure it out.

    Is there a way i can add code to log somehere when and why the home page is cleared ?

    Raam Dev

    (@raamdev)

    @massimod I wrote a KB Article for you that explains how you can run a backtrace inside the necessary Comet Cache function to figure out what’s calling it:

    https://cometcache.com/kb-article/debugging-auto-clear-routines/

    Thread Starter massimod

    (@massimod)

    Thanks a lot !

    doume

    (@doume)

    Hello,

    I have the all cache cleared daily. It seems to happen each time _cron_comet_cache_cleanup runs (02:00 AM).
    Is it possible, to find the reason faster, to use the debug code in several Wcp files at the same time (assuming that the log files have different names)?

    D.

    CC Lite Version 170220 / WP 4.7.2 / PHP 7.1.1

    Raam Dev

    (@raamdev)

    @doume It sounds like you might have the Cache Expiration time set to 1 day. If you don’t want the cache to expire every day, you can increase the expiration time in Comet Cache → Plugin Options → Cache Expiration Time.

    doume

    (@doume)

    My configuration is 15 days / 1 per day / other parameters default value.

    Raam Dev

    (@raamdev)

    @doume In that case, I suggest following the debugging steps I mentioned in this article above: https://cometcache.com/kb-article/debugging-auto-clear-routines/

    Or you can disable all of your other WordPress plugins and re-enable them one-by-one until you find the plugin that’s triggering the daily clear/wipe of the entire cache.

    doume

    (@doume)

    I already started to use your debug method (thanks btw) but is it possible, to find the reason faster, to use the debug code in several Wcp files at the same time (assuming that the log files have different names)?

    D.

    • This reply was modified 8 years ago by doume.
    Raam Dev

    (@raamdev)

    @doume The only faster way would be to disable other plugins one-by-one to see if you can find the plugin that’s causing the problem.

    Thread Starter massimod

    (@massimod)

    It seems that a lot of pluging hook and clear the home page. In my initial post here the offender plugin was Anspress.

    But now i see that a LOT of plugins do that, like POSTMAN and wpForo. So maybe this is not their problem but something in Comet Cache ? Are all plugin doing something wrong ?

    Thanks

    @massimod Yes, nearly all WordPress plugins use the WordPress Plugin API. Hooks are one of the best things about WordPress, as it allows one plugin to hook into WordPress without needing to know what other plugins might be running on the site. This allows Comet Cache to attach to a hook, e.g., the save_post hook, and automatically clear the cache whenever that hook is fired. If there’s another plugin installed on the site that does something with changing the content of a post, it should (if it has been coded properly) end up firing the same save_post hook, which will then cause Comet Cache to clear the appropriate cache file—this is all possible without Comet Cache having any knowledge of the other plugin, all thanks to the WordPress Plugin API.

    There are lots of WordPress hooks that Comet Cache listens to (it has to, as it’s a caching plugin, which means that it affects the entire front-end of a site and therefore it needs to listen for any possible changes that might require refreshing the cache for the front-end). Here’s a list of hooks that Comet Cache attaches to. You can review that list and inspect the Comet Cache source code to figure out which hooks might be causing the Home Page cache to be cleared, and then search through the source code for the plugins you’re using to see which plugins might be firing those same hooks.

    The other approach would be to disable plugins one-by-one until you find the one that’s causing the Home Page cache to be cleared unnecessarily.

    Note that a lot of plugin developers don’t take into consideration the fact that a caching plugin might be installed, so they might unnecessarily call certain hooks, which results in the cache being cleared even when nothing on the front-end changed.

    We work hard to improve compatibility in instances where a specific integration is necessary and we’re always happy to review any plugins that seem like they don’t work well with Comet Cache.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Home Page cleared daily’ is closed to new replies.