• Resolved Derek Wilcox

    (@themassapothecary)


    wp_cron_preload_cache: scheduling the next preload in 3 seconds.

    wpsc_delete_files: remove directory ABSPATH/wp-content/cache/supercache/p0******-staging.onrocket.site/

    We have expert mode enabled. We have cache timeout set to 0 (disabled) and even though it is set to 0, under the section for scheduled garbage cleanup we added 9223372036854775807 for the seconds so it is over a lifetime just in case there was a glitch and it was still running.

    Preload is used and for the setting  “Preload mode (garbage collection disabled. Recommended.)”, we tried with enabled or disabled, and the cache still clears automatically.

    We also checked if any old cron jobs or something was clearing the cache, but there are none. it has to be getting called via a function within the super cache plugin.

    We enabled the debug feature in the plugin and immediately after the cache cleared by iteself we saw it is getting called to be deleted by the plugin itself with the function wpsc_delete_files. It shoudn’t be, but I don’t know how to stop it.

    Any help is greatly appreciated!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there, @themassapothecary,

    If I got what you’re asking, it sounds like you’re experiencing the preload “cleaning up” after itself to make sure no cached files older than the preload time exist.

    If you have preload enabled to run all the time, it forces a cleanup of old files:

    if ( $wp_cache_preload_interval > 0 ) {
    $cache_max_time = (int)$wp_cache_preload_interval * 60; // fool the GC into expiring really old files
    } else {
    $cache_max_time = 86400; // fool the GC into expiring really old files
    }
    if ( $wp_cache_preload_email_me )
    wp_mail( get_option( ‘admin_email’ ), sprintf( __( ‘[%s] Cache Preload Completed’, ‘wp-super-cache’ ), home_url() ), __( “Cleaning up old supercache files.”, ‘wp-super-cache’ ) . “\n” . $msg );
    if ( $cache_max_time > 0 ) { // GC is NOT disabled
    wp_cache_debug( “wp_cron_preload_cache: clean expired cache files older than $cache_max_time seconds.”, 5 );
    wp_cache_phase2_clean_expired( $file_prefix, true ); // force cleanup of old files.
    }

    (Reading the comments in the code above will help.)

    Our developers confirm that what you are trying to avoid somehow is, in fact, the expected behaviour of the plugin. Maybe that’s not what you expect, but if it’s preloading all the time, then you’d want to get fresh cache files.

    Hope that helps and makes sense! Please feel free to reach out if you have any other questions or need some more help.

    Thread Starter Derek Wilcox

    (@themassapothecary)

    Ok then what do I need to do to preload all page/posts/products/etc, and then disable it unless i manually trigger it so that it doesn’t automatically preload?

    It specifically states in docs that when preload is enabled and expert mode for cache (mod rewrite rules used) that garbage collection is disabled.

    Yet, it still does this. I set the cache age to over 100 years and it still triggers preloads every 6-12 hours. I want all the pages cached and then them staying cached until I manually trigger the cache to be cleared and a new preload initiated after that. How can I accomplish this?

    Thread Starter Derek Wilcox

    (@themassapothecary)

    @erania-pinnera or, how about this. Is there a filter I can hook into to change the frequency at which the preload begins? That way I can add a snippet to the functions.php and make it not happen every 6 hours (or whatever it is) and change to what I want.

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hello @themassapothecary,

    I asked our tech team to take a look at your case. Upon checking the plugin code to ensure we’re not missing anything, they suggested trying the following:

    • set the option “Refresh preloaded cache files every 0 minutes” on the preload settings page by entering 0 (zero) in the box before “minutes.

    This should help improve the situation. Let us know how it goes!

    Thread Starter Derek Wilcox

    (@themassapothecary)

    @erania-pinnera sorry, I thought I said that already. The setting you mentioned is already set to 0 (disabled) and it still deletes cache abd orekisds every several hours.

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hey @themassapothecary,

    No worries – apologies if I missed it. I’ll bring this back to our developers, and we’ll get back to you once we hear from them.

    We appreciate the patience, and speak soon 🙂

    Hi,

    Sorry for not getting back to you sooner. The wpsc_delete_files command you’re seeing in the logs only deletes files in a directory. In this case, it’s deleting the homepage after every loop through your posts, which is happening to keep it refreshed. It should not be deleting your entire cache.

    I’m not sure why the preload is being restarted 6 to 12 hours later however. Is your server prone to crashing? Are you working on it during preload which might accidentally add temporary PHP fatal errors? There’s a cache counter in the plugin that is usually reset after preload but in some very rare edge cases it might not be. I have an idea for a fix for that, but until we get a new release out, comment out line 3742 in wp-cache.php:

    add_action( 'init', 'check_up_on_preloading' ); // sometimes preloading stops working. Kickstart it.

    If that fixes the problem of restarting preloads after 6 to 12 hours I will be very interested to hear about it.

    EDIT: You can still try commenting out that line, but I’m not sure if it will fix the problem of the restarting preloads. That check_up_on_preloading() function is supposed to restart preloading if it is interrupted for some reason.

    It may well be another plugin or other code you have on your server that’s restarting preloading.

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hey @themassapothecary,

    Do you have updates about that, do you still need help? We usually close inactive threads after one week of no movement, but we want to make sure we’re all set before marking it as solved. Thanks!

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

You must be logged in to reply to this topic.